Skip to content

Commit

Permalink
Fix bug caused by uninitialized variable in typechecker
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
  • Loading branch information
Mihai Budiu committed Nov 22, 2022
1 parent aa0a24c commit 0ecbda1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontends/p4/typeChecking/typeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ TypeInference::TypeInference(ReferenceMap* refMap, TypeMap* typeMap, bool readOn
typeMap(typeMap),
initialNode(nullptr),
readOnly(readOnly),
checkArrays(checkArrays) {
checkArrays(checkArrays),
currentActionList(nullptr) {
CHECK_NULL(typeMap);
CHECK_NULL(refMap);
visitDagOnce = false; // the done() method will take care of this
Expand Down
2 changes: 1 addition & 1 deletion lib/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ limitations under the License.
#define _GLIBCXX_USE_NOEXCEPT _NOEXCEPT
#endif

#if HAVE_LIBGC
static bool done_init, started_init;
// emergency pool to allow a few extra allocations after a bad_alloc is thrown so we
// can generate reasonable errors, a stack trace, etc
static char emergency_pool[16 * 1024];
static char* emergency_ptr;

// One can disable the GC, e.g., to run under Valgrind, by editing config.h
#if HAVE_LIBGC
void* operator new(std::size_t size) {
/* DANGER -- on OSX, can't safely call the garbage collector allocation
* routines from a static global constructor without manually initializing
Expand Down

0 comments on commit 0ecbda1

Please sign in to comment.