From ac1c2809f8925b389e1ab153ad15398424955d3f Mon Sep 17 00:00:00 2001 From: pmichaud Date: Sat, 26 Jun 2010 16:10:32 -0500 Subject: [PATCH] Assigning Nil to a container resets it to type. --- src/builtins/assign.pir | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/builtins/assign.pir b/src/builtins/assign.pir index 6427d4a50b9..c51ef7022d5 100644 --- a/src/builtins/assign.pir +++ b/src/builtins/assign.pir @@ -47,8 +47,18 @@ src/builtins/assign.pir - assignment operations goto cont_loop scalar_assign: - # put the source in item context, fully dereference it, and set the - # lhs objectref to it + # check for Nil assignment + $I0 = isa source, ['Parcel'] + unless $I0 goto item_assign + $I0 = elements source + if $I0 goto item_assign + nil_assign: + source = getprop 'type', cont + unless null source goto have_source + source = get_hll_global '$!OBJECTREF' + goto have_source + item_assign: + # put the source in item context $I0 = can source, 'item' unless $I0 goto have_source source = source.'item'()