The following causes a crash when translated:
without inline
function bar()
sequence s = {1,2,3} + 1
return s[1]
end function
? bar()
For some reason, the translator assumes that s should be an integer, and translates as follows:
/** sequence s = {1,2,3} + 1*/
{ // coercing _s_142 to an integer 1
_s_142 = binary_op(PLUS, 1, _10);
if( !IS_ATOM_INT(_s_142) ){
_s_142 = (object)DBL_PTR(_s_142)->dbl;
}
}
The IL disassembly shows that a
PLUS1 op is emitted.
3: 093 145 0 142 # PLUS1: [LIT {1,2,3}:145] + 1 => [s:142]
Other
PLUS ops might also be affected. When the code is inlined into the top level, it translates correctly. The problem may be with BB value tracking in the translator.
changeset: 5290:73cf3d110e2f branch: 4.0 parent: 5286:5062bba3b0dc user: Matt Lewis date: Wed Nov 30 17:32:26 2011 -0500 files: docs/release/4.0.4.txt source/c_decl.e tests/t_math.e description: