[Nickle] nickle: Branch 'master'
    Keith Packard 
    keithp at keithp.com
       
    Sat Dec  2 12:50:30 PST 2023
    
    
  
 symbol.c |    3 +++
 1 file changed, 3 insertions(+)
New commits:
commit 9ea2939a09be7958cd36c92a9834bea7a9a2e1df
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Dec 2 12:49:25 2023 -0800
    Initialize SymbolLocal 'code' in allocators
    
    Make sure this pointer is set before returning so that
    it doesn't trip up the garbage collector if run before
    the correct value is assigned.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/symbol.c b/symbol.c
index d1ea247..47e58b2 100644
--- a/symbol.c
+++ b/symbol.c
@@ -153,6 +153,7 @@ NewSymbolArg (Atom name, Type *type)
     s->symbol.type = type;
     s->symbol.forward = False;
     s->local.element = 0;
+    s->local.code = 0;
     RETURN (s);
 }
 
@@ -169,6 +170,7 @@ NewSymbolAuto (Atom name, Type *type)
     s->symbol.type = type;
     s->symbol.forward = False;
     s->local.element = -1;
+    s->local.code = 0;
     RETURN (s);
 }
 
@@ -185,6 +187,7 @@ NewSymbolStatic (Atom name, Type *type)
     s->symbol.type = type;
     s->symbol.forward = False;
     s->local.element = -1;
+    s->local.code = 0;
     RETURN (s);
 }
 
    
    
More information about the Nickle
mailing list