diff options
author | Andy Wingo <wingo@pobox.com> | 2009-07-26 12:56:11 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-07-26 12:57:11 +0200 |
commit | 28b119ee3da0f4b14cb87e638794d22843778cda (patch) | |
tree | 8adb2157d4fcb5b53e4484af43729ada2a33b981 /module/language/assembly/decompile-bytecode.scm | |
parent | 9efc2d1404aa7705f38aa1ceaebf4c4893e68b83 (diff) | |
download | guile-28b119ee3da0f4b14cb87e638794d22843778cda.tar.gz |
make sure all programs are 8-byte aligned
* libguile/objcodes.c (OBJCODE_COOKIE): Bump objcode cookie, as we added
to struct scm_objcode.
* libguile/objcodes.h (struct scm_objcode): Add a uint32 after metalen
and before base, so that if the structure has 8-byte alignment, base
will have 8-byte alignment too. (Before, base was 12 bytes from the
start of the structure, now it's 16 bytes.)
* libguile/vm-engine.h (ASSERT_ALIGNED_PROCEDURE): Add a check that can
be turned on with VM_ENABLE_PARANOID_ASSERTIONS.
(CACHE_PROGRAM): Call ASSERT_ALIGNED_PROCEDURE.
* libguile/vm-i-system.c (long-local-ref): Add a missing semicolon.
* libguile/vm.c (really_make_boot_program): Rework to operate directly
on a malloc'd buffer, so that the program will be 8-byte aligned.
* module/language/assembly.scm (*program-header-len*): Add another 4 for
the padding.
(object->assembly): Fix case in which we would return (make-int8 0)
instead of (make-int8:0). This would throw off compile-assembly.scm's
use of addr+.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
out the padding int.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
And pop off the padding int too.
* module/language/glil/compile-assembly.scm (glil->assembly): Don't pack
the assembly, assume that assembly.scm has done it for us. If a
program has a meta, pad out the program so that meta will be aligned.
* test-suite/tests/asm-to-bytecode.test: Adapt to expect programs to
have the extra 4-byte padding int.
Diffstat (limited to 'module/language/assembly/decompile-bytecode.scm')
-rw-r--r-- | module/language/assembly/decompile-bytecode.scm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/module/language/assembly/decompile-bytecode.scm b/module/language/assembly/decompile-bytecode.scm index 231205d08..82459fc6f 100644 --- a/module/language/assembly/decompile-bytecode.scm +++ b/module/language/assembly/decompile-bytecode.scm @@ -57,6 +57,7 @@ (len (+ a (ash b 8) (ash c 16) (ash d 24))) (metalen (+ e (ash f 8) (ash g 16) (ash h 24))) (totlen (+ len metalen)) + (pad0 (pop)) (pad1 (pop)) (pad2 (pop)) (pad3 (pop)) (labels '()) (i 0)) (define (ensure-label rel1 rel2) |