From 5acca750ff79e1bbd442ed5b3497963df590bb5f Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Mon, 23 Jan 2017 18:25:58 -0500 Subject: [PATCH] x86: Correct totally bogus calculation in FIXUP-CODE-OBJECT. (code-header-ref code 1), which is the same as (%code-code-size code), should not be multiplied by n-word-bytes. It's in bytes, not words. I have no idea how this didn't produce random memory coruption. --- src/code/x86-vm.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/code/x86-vm.lisp b/src/code/x86-vm.lisp index d26052e15..e9c34e41d 100644 --- a/src/code/x86-vm.lisp +++ b/src/code/x86-vm.lisp @@ -85,8 +85,7 @@ (obj-start-addr (logand (get-lisp-obj-address code) #xfffffff8)) (code-start-addr (sap-int (code-instructions code))) - (ncode-words (code-header-ref code 1)) - (code-end-addr (+ code-start-addr (* ncode-words n-word-bytes)))) + (code-end-addr (+ code-start-addr (%code-code-size code)))) (unless (member kind '(:absolute :relative)) (error "Unknown code-object-fixup kind ~S." kind)) (ecase kind -- 2.11.4.GIT