Mercurial > projects > ddmd
diff dmd/ArrayLiteralExp.d @ 135:af1bebfd96a4 dmd2037
dmd 2.038
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 13 Sep 2010 22:19:42 +0100 |
parents | 60bb0fe4563e |
children | 438eaa11eed4 |
line wrap: on
line diff
--- a/dmd/ArrayLiteralExp.d Sat Sep 11 13:03:39 2010 +0100 +++ b/dmd/ArrayLiteralExp.d Mon Sep 13 22:19:42 2010 +0100 @@ -213,10 +213,7 @@ ex = e.interpret(istate); if (ex is EXP_CANT_INTERPRET) - { - delete expsx; - return EXP_CANT_INTERPRET; - } + goto Lerror; /* If any changes, do Copy On Write */ @@ -239,10 +236,7 @@ { expandTuples(expsx); if (expsx.dim != elements.dim) - { - delete expsx; - return EXP_CANT_INTERPRET; - } + goto Lerror; ArrayLiteralExp ae = new ArrayLiteralExp(loc, expsx); ae.type = type; @@ -250,6 +244,12 @@ return ae; } return this; + + Lerror: + if (expsx) + delete expsx; + error("cannot interpret array literal"); + return EXP_CANT_INTERPRET; } override MATCH implicitConvTo(Type t)