D - BUG?
- Stephan Wienczny (5/5) Jan 30 2004 When compiling I get this error.
- imr1984 (1/1) Jan 30 2004 ?
- Stephan Wienczny (5/8) Jan 30 2004 Looking at the source of expression.c, its obvious what is wrong.
- J C Calvarese (42/49) Jan 30 2004 dmd\src\dmd\expression.c (line 1191)
- Stephan Wienczny (13/73) Jan 30 2004 See my other post!
- J C Calvarese (7/88) Jan 30 2004 It didn't show up in my newsreader until AFTER I posted!
- Stephan Wienczny (2/5) Jan 30 2004 Thanks for your time!
When compiling I get this error. I've not yet found which sourcelines produce it. Walter do you have a clue what it could be? dmd: expression.c:1191: virtual int StringExp::compare(Object*): Assertion `0' failed.
Jan 30 2004
imr1984 wrote:?Looking at the source of expression.c, its obvious what is wrong. I'm using a dchar and there is "not yet" an compare function for UTF32, although I use Linux and wchar_t is UTF32..... Stephan
Jan 30 2004
Stephan Wienczny wrote:When compiling I get this error. I've not yet found which sourcelines produce it. Walter do you have a clue what it could be? dmd: expression.c:1191: virtual int StringExp::compare(Object*): Assertion `0' failed.dmd\src\dmd\expression.c (line 1191) Maybe you're comparing an object's string to another string? Apparently sz (whatever that is) isn't 1 or 2, so it's a situation that Walter didn't plan for, but he planned for it enough to put an assert in there... I think whatever happened is a bug since the compiler should have at least indicated WHERE it occurred (and hopefully WHY, too) in your source. If you could post some code that exhibits this problem, someone may be able to help you snip it down to a clear error report. excerpt from dmd\src\dmd\expression.c (around 1191)... int StringExp::compare(Object *obj) { // Used to sort case statement expressions so we can do an efficient lookup StringExp *se2 = (StringExp *)(obj); // This is a kludge so isExpression() in template.c will return 5 // for StringExp's. if (!se2) return 5; assert(se2->op == TOKstring); int len1 = len; int len2 = se2->len; if (len1 == len2) { switch (sz) { case 1: return strcmp((char *)string, (char *)se2->string); case 2: return wcscmp((wchar_t *)string, (wchar_t *)se2->string); case 4: /* not implemented */ default: assert(0); /* ****** line 1191 ****** */ } } return len1 - len2; } -- Justin http://jcc_7.tripod.com/d/
Jan 30 2004
J C Calvarese wrote:Stephan Wienczny wrote:See my other post! case 1: UTF8 case 2: UTF16 case 4: UTF32 //dchar on Linux I've got some expression like this one: if ((cast(Operator)(curiter.Value)).value == ".") mit Value definiert als class Operator { dchar Value(); } p.s.: freinhand geschrieben, da sourcen gerade nicht vorhandenWhen compiling I get this error. I've not yet found which sourcelines produce it. Walter do you have a clue what it could be? dmd: expression.c:1191: virtual int StringExp::compare(Object*): Assertion `0' failed.dmd\src\dmd\expression.c (line 1191) Maybe you're comparing an object's string to another string? Apparently sz (whatever that is) isn't 1 or 2, so it's a situation that Walter didn't plan for, but he planned for it enough to put an assert in there... I think whatever happened is a bug since the compiler should have at least indicated WHERE it occurred (and hopefully WHY, too) in your source. If you could post some code that exhibits this problem, someone may be able to help you snip it down to a clear error report. excerpt from dmd\src\dmd\expression.c (around 1191)... int StringExp::compare(Object *obj) { // Used to sort case statement expressions so we can do an efficient lookup StringExp *se2 = (StringExp *)(obj); // This is a kludge so isExpression() in template.c will return 5 // for StringExp's. if (!se2) return 5; assert(se2->op == TOKstring); int len1 = len; int len2 = se2->len; if (len1 == len2) { switch (sz) { case 1: return strcmp((char *)string, (char *)se2->string); case 2: return wcscmp((wchar_t *)string, (wchar_t *)se2->string); case 4: /* not implemented */ default: assert(0); /* ****** line 1191 ****** */ } } return len1 - len2; }
Jan 30 2004
Stephan Wienczny wrote:J C Calvarese wrote:It didn't show up in my newsreader until AFTER I posted! (Maybe I took too long writing my reply. Sorry! :))Stephan Wienczny wrote:See my other post!When compiling I get this error. I've not yet found which sourcelines produce it. Walter do you have a clue what it could be? dmd: expression.c:1191: virtual int StringExp::compare(Object*): Assertion `0' failed.dmd\src\dmd\expression.c (line 1191) Maybe you're comparing an object's string to another string? Apparently sz (whatever that is) isn't 1 or 2, so it's a situation that Walter didn't plan for, but he planned for it enough to put an assert in there... I think whatever happened is a bug since the compiler should have at least indicated WHERE it occurred (and hopefully WHY, too) in your source. If you could post some code that exhibits this problem, someone may be able to help you snip it down to a clear error report. excerpt from dmd\src\dmd\expression.c (around 1191)... int StringExp::compare(Object *obj) { // Used to sort case statement expressions so we can do an efficient lookup StringExp *se2 = (StringExp *)(obj); // This is a kludge so isExpression() in template.c will return 5 // for StringExp's. if (!se2) return 5; assert(se2->op == TOKstring); int len1 = len; int len2 = se2->len; if (len1 == len2) { switch (sz) { case 1: return strcmp((char *)string, (char *)se2->string); case 2: return wcscmp((wchar_t *)string, (wchar_t *)se2->string); case 4: /* not implemented */ default: assert(0); /* ****** line 1191 ****** */ } } return len1 - len2; }case 1: UTF8 case 2: UTF16 case 4: UTF32 //dchar on Linux I've got some expression like this one: if ((cast(Operator)(curiter.Value)).value == ".") mit Value definiert als class Operator { dchar Value(); } p.s.: freinhand geschrieben, da sourcen gerade nicht vorhandenI was only trying to help... -- Justin http://jcc_7.tripod.com/d/
Jan 30 2004
J C Calvarese wrote:I was only trying to help...Thanks for your time!
Jan 30 2004