blueloveTH vor 8 Monaten
Ursprung
Commit
790710b1a4
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. 8 0
      CMakeLists.txt
  2. 1 1
      src/interpreter/vm.c

+ 8 - 0
CMakeLists.txt

@@ -20,6 +20,11 @@ if(MSVC)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox")
         add_definitions(-DNDEBUG)
     endif()
+
+    # if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+    #     message(">> Enable Address Sanitizer")
+    #     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address /Zi")
+    # endif()
 else()
     if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
@@ -99,6 +104,9 @@ if(PK_ENABLE_DETERMINISM)
     endif()
 endif()
 
+find_package(Threads REQUIRED)
+target_link_libraries(${PROJECT_NAME} Threads::Threads)
+
 if(UNIX AND NOT APPLE)
     if(NOT PK_ENABLE_DETERMINISM)
         # use platform libm

+ 1 - 1
src/interpreter/vm.c

@@ -260,11 +260,11 @@ void VM__dtor(VM* self) {
     while(self->top_frame)
         VM__pop_frame(self);
     BinTree__dtor(&self->modules);
-    c11_vector__dtor(&self->types);
     FixedMemoryPool__dtor(&self->pool_frame);
     ValueStack__dtor(&self->stack);
     CachedNames__dtor(&self->cached_names);
     NameDict__dtor(&self->compile_time_funcs);
+    c11_vector__dtor(&self->types);
 }
 
 void VM__push_frame(VM* self, py_Frame* frame) {