[Vm-dev] Something wrong in latest code generation

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Nov 26 16:30:17 UTC 2017


This wrong generation is what makes the mac osx 64bits cog spur SEGV...

2017-11-24 14:13 GMT+01:00 Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com>:

> Hi Eliot,
> if i look at spur64src/vm/cointerp.c generated from VMMaker.oscog-eem.2277
> i see something wrong in primitiveAdd:
>
> static void
> primitiveAdd(void)
> {   DECL_MAYBE_SQ_GLOBAL_STRUCT
>     sqInt integerResult;
>     char *sp;
>
>     /* begin pop2AndPushIntegerIfOK: */
> ======================================
> See below: we test if primitive failed before we tried...
> ======================================
>     if (!GIV(primFailCode)) {
>         integerResult = (stackIntegerValue(1)) + (stackIntegerValue(0));
>         if ((((((usqInt) integerResult) >> 60) + 1) & 15) <= 1) {
>             /* begin pop:thenPush: */
>             longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)),
> (((usqInt)integerResult << 3) | 1));
>             GIV(stackPointer) = sp;
>         }
>         else {
>             /* begin success: */
>
>             /* Don't overwrite an error code that has already been set. */
>             if (!GIV(primFailCode)) {
>                 GIV(primFailCode) = 1;
>             }
>
>         }
>     }
> }
>
>
> Note that I could comment the commit in github API.
> Unfortunately, diff are too big, and comments uneasy to find/view/scan.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20171126/5ef59449/attachment.html>


More information about the Vm-dev mailing list