summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-02-06 00:48:43 +0000
committerOmar Rizwan <omar@omar.website>2023-02-06 00:48:43 +0000
commit620d7ef6b19e41faef5f92f98c1fa4e298d681fe (patch)
tree11453574157d589afd183947cccdb09c4e849c76 /lib
parentSome README tweaks (diff)
downloadfolk-620d7ef6b19e41faef5f92f98c1fa4e298d681fe.tar.gz
folk-620d7ef6b19e41faef5f92f98c1fa4e298d681fe.zip
c-statements: More handle cleanup. Animal test works
Main bug was setting up rtype with ckalloc instead of Tcl_NewObj, which resulted in weird refcount reuse behavior.
Diffstat (limited to 'lib')
-rw-r--r--lib/c.tcl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/c.tcl b/lib/c.tcl
index 27b7a2cb..39e2fdd3 100644
--- a/lib/c.tcl
+++ b/lib/c.tcl
@@ -254,7 +254,7 @@ namespace eval c {
variable rtypes
rtype $type {
- $robj = ckalloc(sizeof(struct Tcl_Obj));
+ $robj = Tcl_NewObj();
$robj->bytes = NULL;
$robj->typePtr = &$[set rtype]_ObjType;
$robj->internalRep.otherValuePtr = ckalloc(sizeof($[set rtype]));
@@ -363,7 +363,7 @@ namespace eval c {
# puts "=====================\n$sourcecode\n====================="
set cfd [file tempfile cfile cfile.c]; puts $cfd $sourcecode; close $cfd
- exec cc -Wall -g -shared -fsanitize=address -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension]
+ exec cc -Wall -g -shared -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension]
load [file rootname $cfile][info sharedlibextension] cfile
}
::proc import {scc sname as dest} {