nooc

nooc programming language compiler
git clone git://git.nihaljere.xyz/nooc
Log | Files | Refs | LICENSE

commit ffcf5cfad776528d397dde33679f84b0e1754778
parent 2547675fd2db30876c61d5b71aa25d95c20a78f9
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Sun, 19 Dec 2021 18:58:50 -0600

type: fix str (pointer) size, and index for types already in table

Diffstat:
Mtype.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/type.c b/type.c @@ -48,6 +48,7 @@ inittypes() mapput(typesmap, &key)->n = idx; type.class = TYPE_STR; + type.size = 8; idx = type_put(&type); mapkey(&key, "str", 3); mapput(typesmap, &key)->n = idx; @@ -130,7 +131,8 @@ type_put(struct type *type) memcpy(table.keys[i].hash, out, 16); array_add((&types), (*type)); table.vals[i] = types.len - 1; + return types.len - 1; } - return types.len - 1; + return table.vals[i]; }