From: weiyu Date: Thu, 1 Aug 2019 23:42:18 +0000 (-0700) Subject: little fixes X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=f85203775e7ad8285c9e33e44ff951e8980feaa9 little fixes --- diff --git a/Makefile b/Makefile index a1d0d27a..26d46297 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 printf.o + sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o CPPFLAGS += -Iinclude -I. LDFLAGS := -ldl -lrt -rdynamic -lpthread diff --git a/cmodelint.cc b/cmodelint.cc index fdac33aa..3c59fa01 100644 --- a/cmodelint.cc +++ b/cmodelint.cc @@ -10,7 +10,7 @@ #include "threads-model.h" #include "datarace.h" -memory_order orders[8] = { +memory_order orders[7] = { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst, }; diff --git a/predicate.cc b/predicate.cc index 00eaaa02..c4724ef9 100644 --- a/predicate.cc +++ b/predicate.cc @@ -5,7 +5,7 @@ Predicate::Predicate(FuncInst * func_inst) : {} unsigned int pred_expr_hash(struct pred_expr * expr) { - return (unsigned int)((uintptr_t)hash); + return (unsigned int)((uintptr_t)expr); } bool pred_expr_equal(struct pred_expr * p1, struct pred_expr * p2) @@ -21,6 +21,6 @@ bool pred_expr_equal(struct pred_expr * p1, struct pred_expr * p2) void Predicate::add_predicate(token_t token, void * location, bool value) { - struct pred_expr = {token, location, value}; + struct pred_expr predicate = {token, location, value}; predicates.add(&predicate); } diff --git a/predicate.h b/predicate.h index 3849e2d8..6cdce912 100644 --- a/predicate.h +++ b/predicate.h @@ -2,6 +2,7 @@ #define __PREDICATE_H__ #include "funcinst.h" +#include "hashset.h" unsigned int pred_expr_hash (struct pred_expr *); bool pred_expr_equal(struct pred_expr *, struct pred_expr *);