From ec138ba57cbdf8132da384edec88f52328bb88fb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 28 Mar 2020 08:33:15 -0600 Subject: [PATCH] repair `compute-size-increments` for anonymous fields The size of a record with anonymous fields was not included in the computed size. original commit: 1c44e61a8174629cacc71adedccc028e982ca323 --- s/inspect.ss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/s/inspect.ss b/s/inspect.ss index a8c5281390..d1fd894aa9 100644 --- a/s/inspect.ss +++ b/s/inspect.ss @@ -2649,7 +2649,7 @@ (let ([flds (rtd-flds rtd)]) (cond [(fixnum? flds) - (let loop ([i 0] [size 0]) + (let loop ([i 0] [size (fx+ (align (rtd-size rtd)) (compute-size rtd))]) (cond [(fx= i flds) size] [else (loop (fx+ i 1) @@ -2707,7 +2707,8 @@ (if (fx= i n) size (let ([r ($get-reloc x i)]) - (and r + (if (not r) + 0 (let ([type (logand (bitwise-arithmetic-shift-right r (constant reloc-type-offset)) (constant reloc-type-mask))]) (if (logtest r (constant reloc-extended-format)) (let ([addr (fx+ addr ($get-reloc x (fx+ i 2)))])