Bug fixes

This commit is contained in:
Justin Ethier 2019-05-16 13:35:51 -04:00
parent cb0d72a6df
commit c9ae6cdf97

View file

@ -421,7 +421,7 @@
(cond (cond
((and immutable use-alloca) ((and immutable use-alloca)
(string-append cvar "->hdr.immutable = 1;")) (string-append cvar "->hdr.immutable = 1;"))
(immutable ;; no alloca ((and immutable (not use-alloca))
(string-append cvar ".hdr.immutable = 1;")) (string-append cvar ".hdr.immutable = 1;"))
(else ""))) ;; Mutable (default), no need to set anything (else ""))) ;; Mutable (default), no need to set anything
@ -586,7 +586,10 @@
";\n" ";\n"
"memcpy(((string_type *)" cvar-name ")->str, " tmp-name "," blen ");\n" "memcpy(((string_type *)" cvar-name ")->str, " tmp-name "," blen ");\n"
"((string_type *)" cvar-name ")->str[" blen "] = '\\0';" "((string_type *)" cvar-name ")->str[" blen "] = '\\0';"
(c-set-immutable-field cvar-name use-alloca immutable) (c-set-immutable-field
(string-append
"((string_type *)" cvar-name ")")
use-alloca immutable)
))))) )))))
(else (else
(c-code/vars (c-code/vars