[Vm-dev] dangerous translation of MiscPrimitivePlugin code
nicolas.cellier.aka.nice at gmail.com
Fri Jul 8 20:49:58 UTC 2016
I don't know if it was reported yet, but we've got some nasty UB detected
by C Compiler warning in primitiveFindSubstring:
warning: unsequenced modification and access to 'index' [-Wunsequenced]
while ((body[startIndex + index]) == (key[(index +=
Effectively, the sequence is well defined in Smalltalk, not in C.
(body at: startIndex + index) == (key at: (index := index + 1))
Since the CCodeGenerator does not handle this,
we should better decompose the Smalltalk code into several instructions.
Hint: mind the C compiler warnings, some of them are true positive!
Half my changes/fixes are driven by them.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev