integer constant overflow
- Posted by raseunew Feb 06, 2011
- 1622 views
Euphoria Interpreter v4.0.0
Linux, Using System Memory
Revision Date: 2010-12-22, Id: 115714454200
the following code crashes when run after translation
the translation commands are
$ euc -con test.ex
$ ./test
constant MINVAL_1 = 2.0 atom MINVAL_2 = 2.0 function doit() atom amt1 = 0 atom amt2 = 0 atom amt3 = 0 atom amt4 = 0 amt1 += MINVAL_1 amt2 -= MINVAL_1 amt3 += MINVAL_2 amt4 -= MINVAL_2 return 0 end function ? doit()
part of the generated code 'test.c' contains
/** amt1 += MINVAL_1*/ _amt1_145 = NewDouble((double)0 + DBL_PTR(-1295837195870999949586246503082820524326358132599250911397783755038038489864013682116184556430441987592636661296475806242151395110594288345544824579900198053196264090075980164902 1131955125999812493113783567960893398430315545464157532966734476954357462767975066016679066281769169231978029986946841820052586496)->dbl); /** amt2 -= MINVAL_1*/ _amt2_146 = NewDouble((double)0 - DBL_PTR(-1295837195870999949586246503082820524326358132599250911397783755038038489864013682116184556430441987592636661296475806242151395110594288345544824579900198053196264090075980164902 1131955125999812493113783567960893398430315545464157532966734476954357462767975066016679066281769169231978029986946841820052586496)->dbl); /** amt3 += MINVAL_2*/ _amt3_147 = NewDouble((double)0 + DBL_PTR(_1MINVAL_2_142)->dbl); /** amt4 -= MINVAL_2*/ _amt4_148 = NewDouble((double)0 - DBL_PTR(_1MINVAL_2_142)->dbl);
gcc compiles fine without error, but the app crashes when run.
tcc (Tiny CC, Fabrice Bellard) does not compile, and crashes
with integer constant overflow error