Browse Source

correctness fixes, thanks to asan

master
Martin Dørum 3 years ago
parent
commit
d726ee311a
4 changed files with 4 additions and 2 deletions
  1. 1
    1
      include/lang2/bitset.h
  2. 1
    0
      lib/vm/vm.c
  3. 1
    1
      test/build.bx
  4. 1
    0
      test/src/examples.t.c

+ 1
- 1
include/lang2/bitset.h View File

@@ -3,7 +3,7 @@

#include <stdlib.h>

typedef long long int l2_bitset_entry;
typedef unsigned long long int l2_bitset_entry;

struct l2_bitset {
l2_bitset_entry *tables;

+ 1
- 0
lib/vm/vm.c View File

@@ -294,6 +294,7 @@ void l2_vm_step(struct l2_vm *vm) {
vm->stack[vm->sptr++] = arr_id;

l2_word ns_id = alloc_val(vm);
func = &vm->values[func_id]; // func might be stale after alloc
vm->values[ns_id].extra.ns_parent = func->func.namespace;
vm->values[ns_id].ns = NULL;
vm->values[ns_id].flags = L2_VAL_TYPE_NAMESPACE;

+ 1
- 1
test/build.bx View File

@@ -1,5 +1,5 @@
files := src ../lib
includes := snow ../include/lang2
defines := SNOW_ENABLED
#sanitizers := address undefined
sanitizers := address undefined
cflags := -g

+ 1
- 0
test/src/examples.t.c View File

@@ -93,6 +93,7 @@ static void check_impl(const char *name) {
snow_fail("%s: %s", example_path, err.message);
}

l2_gen_free(&gen);
fclose(inf);

FILE *outf = fopen(example_actual_path, "w");

Loading…
Cancel
Save