Skip to content
Felix S. Klock II edited this page Jul 28, 2013 · 1 revision

This page is to take notes on the Sassy source base. It's not intended for Larceny specific stuff (though if Sassy is incompatible with Larceny for some reason, then it wouldn't be absurd to point it out here).


(Potential) Bugs:

  1. Why do the export directives affect the assembly output below? (That is, adding exports turns a 10 and an 8 to zeroes!)

> (sassy-text-list 
   (sassy '((export c_s_1) (export c_s_2) 
            (text (je c_s_2) (xor ebx ebx) (mov (& ecx 14) ebx) (jmp c_s_1) 
                  (label c_s_2) (mov ebx 4) (mov (& ecx 14) ebx) (label c_s_1)))))
(15 132 0 0 0 0 49 219 137 89 14 233 0 0 0 0 187 4 0 0 0 137 89 14)

> (sassy-text-list 
   (sassy '((text (je c_s_2) (xor ebx ebx) (mov (& ecx 14) ebx) (jmp c_s_1) 
                  (label c_s_2) (mov ebx 4) (mov (& ecx 14) ebx) (label c_s_1)))))
(15 132 10 0 0 0 49 219 137 89 14 233 8 0 0 0 187 4 0 0 0 137 89 14)
  • (Jonathan Kraut says this is fixed in sassy--mainline--0.2.1--patch-10)
  1. GDB's disassembler and Sassy seem to be disagreeing on some input I'm feeding it (I think).
  • The key instruction that I'm questioning is (sub esp 152)
  • Sassy is assembling this to the byte sequence #x83 #xec #x98
  • GDB seems to be disassembling it as sub $0xffffff98,%ebp
    • At runtime, when I step over the instruction in question, $ebp is 0x861f80 before the step, and 0x861fe8 after the step.
    • This means that we effectively subtracted -104 (in other words, we added 104). This isn't what we wanted at all.
  • Perhaps Sassy is once again optimistically matching a numeric input as unsigned when the instruction in question is going to interpret the encoded number as signed. (Except I'm not sure that hypothesis makes sense given the numbers that are involved...)
Clone this wiki locally