From 8f19f14c1f5ef9c19e3d5c2616ac6d876999937a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 27 Aug 2009 04:09:35 -0500 Subject: [PATCH] compiler.cfg.instructions: forgot that ##box-displaced-alien needs a GC check; fixes segfault in benchmark.mandel --- basis/compiler/cfg/instructions/instructions.factor | 7 ++++++- basis/compiler/tests/codegen.factor | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/basis/compiler/cfg/instructions/instructions.factor b/basis/compiler/cfg/instructions/instructions.factor index bd93214297..b98e24253d 100644 --- a/basis/compiler/cfg/instructions/instructions.factor +++ b/basis/compiler/cfg/instructions/instructions.factor @@ -153,7 +153,12 @@ INSN: ##set-alien-double < ##alien-setter ; ! Memory allocation INSN: ##allot < ##flushable size class temp ; -UNION: ##allocation ##allot ##box-float ##box-alien ##integer>bignum ; +UNION: ##allocation +##allot +##box-float +##box-alien +##box-displaced-alien +##integer>bignum ; INSN: ##write-barrier < ##effect card# table ; diff --git a/basis/compiler/tests/codegen.factor b/basis/compiler/tests/codegen.factor index 5f06fc8d2a..d45b4aa151 100644 --- a/basis/compiler/tests/codegen.factor +++ b/basis/compiler/tests/codegen.factor @@ -401,4 +401,10 @@ cell 4 = [ dup [ [ 1 fixnum+fast ] dip ] [ [ drop 1 ] dip ] if ; [ 2 t ] [ 0 t global-dcn-bug-1 ] unit-test -[ 1 f ] [ 0 f global-dcn-bug-1 ] unit-test \ No newline at end of file +[ 1 f ] [ 0 f global-dcn-bug-1 ] unit-test + +! Forgot a GC check +: missing-gc-check-1 ( a -- b ) { fixnum } declare ; +: missing-gc-check-2 ( -- ) 10000000 [ missing-gc-check-1 drop ] each-integer ; + +[ ] [ missing-gc-check-2 ] unit-test \ No newline at end of file