[Issue 2176] Assertion failure: 'sz == es2->sz' on line 1339 in file 'constfold.c' (concatenating strings of different types)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 25 22:30:24 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2176


davidl at 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




------- Comment #1 from davidl at 126.com  2008-06-26 00:30 -------
constfold.c  :
789 or so
    else if (e1->op == TOKstring && e2->op == TOKstring)
    {   StringExp *es1 = (StringExp *)e1;

+++     if (sz != es2.sz)
+++     {
+++         error("cannot concatnate two different string type");
+++         return e;
+++     }
---      assert(es1->sz == es2->sz);

1339 line or so
        Type *t;
        size_t len = es1->len + es2->len;
        int sz = es1->sz;


+++     if (sz != es2.sz)
+++     {
+++         error("cannot concatnate two different string type");
+++         return e;
+++     }
---      assert(es1->sz == es2->sz);


-- 



More information about the Digitalmars-d-bugs mailing list