Raymond Toy pushed to branch issue-262-fix-arch-skip-inst-invalid at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/x86-arch.c
    ... ... @@ -35,7 +35,7 @@ static const unsigned char ud1[] = {0x0f, 0xb9};
    35 35
      * the 3rd byte of the UD1 instruction that represents the mod r/m
    
    36 36
      * byte.
    
    37 37
      */
    
    38
    -#define UD1_CODE(byte) ((byte) & 0x3f)
    
    38
    +#define UD1_CODE(modrm) ((modrm) & 0x3f)
    
    39 39
     
    
    40 40
     /*
    
    41 41
      * Set to positive value to enabled debug prints related to the sigill
    
    ... ... @@ -394,7 +394,7 @@ sigill_handler(HANDLER_ARGS)
    394 394
            * number is placed in the low 6-bits of the 3rd byte of the
    
    395 395
            * instruction.
    
    396 396
            */
    
    397
    -      trap = UD1_CODE(*(((char *)SC_PC(context)) + 2));
    
    397
    +      trap = UD1_CODE(*(((char *)SC_PC(context)) + sizeof(ud1)));
    
    398 398
     
    
    399 399
           DPRINTF(debug_handlers, (stderr, "code = %x\n", trap));
    
    400 400