From 8b3bff063ed9640c7bb8e73b79dcc50b54c775ad Mon Sep 17 00:00:00 2001 From: weiyu Date: Mon, 26 Aug 2019 16:05:36 -0700 Subject: [PATCH] fix bug --- Makefile | 2 +- funcnode.cc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 26d46297..edff29be 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ OBJECTS := libthreads.o schedule.o model.o threads.o librace.o action.o \ datarace.o impatomic.o cmodelint.o \ snapshot.o malloc.o mymemory.o common.o mutex.o conditionvariable.o \ context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o \ - sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o + sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o newfuzzer.o CPPFLAGS += -Iinclude -I. LDFLAGS := -ldl -lrt -rdynamic -lpthread diff --git a/funcnode.cc b/funcnode.cc index f4c6c986..8765c373 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -527,6 +527,9 @@ void FuncNode::add_to_val_loc_map(uint64_t val, void * loc) void FuncNode::add_to_val_loc_map(value_set_t * values, void * loc) { + if (values == NULL) + return; + value_set_iter * it = values->iterator(); while (it->hasNext()) { uint64_t val = it->next(); @@ -574,6 +577,12 @@ void FuncNode::unset_predicate_tree_position(thread_id_t tid) predicate_tree_position[thread_id] = NULL; } +Predicate * FuncNode::get_predicate_tree_position(thread_id_t tid) +{ + uint thread_id = id_to_int(tid); + return predicate_tree_position[thread_id]; +} + void FuncNode::print_predicate_tree() { model_print("digraph function_%s {\n", func_name); -- 2.34.1