From bd152c65049a960905fa2c04929b0360a14d0203 Mon Sep 17 00:00:00 2001 From: Ajay Brahmakshatriya Date: Thu, 12 Dec 2024 09:10:02 -0500 Subject: [PATCH 1/2] Fixed parents_stack being static --- include/builder/dyn_var.h | 3 ++- src/builder/builder.cpp | 2 ++ src/builder/builder_context.cpp | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/builder/dyn_var.h b/include/builder/dyn_var.h index cc7a2e2..65704e1 100644 --- a/include/builder/dyn_var.h +++ b/include/builder/dyn_var.h @@ -64,7 +64,8 @@ struct custom_type : custom_type_base { } }; -static std::vector *parents_stack = nullptr; +extern std::vector *parents_stack; + // Struct to initialize a dyn_var as member; struct as_member { var *parent_var; diff --git a/src/builder/builder.cpp b/src/builder/builder.cpp index 4210c6b..98d9dc2 100644 --- a/src/builder/builder.cpp +++ b/src/builder/builder.cpp @@ -8,6 +8,8 @@ namespace options { bool track_members = false; } +std::vector *parents_stack = nullptr; + template <> std::vector extract_type_vector_dyn<>(void) { std::vector empty_vector; diff --git a/src/builder/builder_context.cpp b/src/builder/builder_context.cpp index 1736327..6af6910 100644 --- a/src/builder/builder_context.cpp +++ b/src/builder/builder_context.cpp @@ -334,6 +334,11 @@ block::stmt::Ptr builder_context::extract_ast_from_function_internal(std::vector current_block_stmt->static_offset.clear(); assert(current_block_stmt != nullptr); ast = current_block_stmt; + + if (parents_stack != nullptr) { + parents_stack->clear(); + } + bool_vector = b; block::stmt::Ptr ret_ast; From ab9721906e4033baeb0b13850d509262a84c9cbf Mon Sep 17 00:00:00 2001 From: Ajay Brahmakshatriya Date: Thu, 12 Dec 2024 09:22:50 -0500 Subject: [PATCH 2/2] Fixed CI on MACOS to get nproc appropriately --- .github/workflows/ci-all-samples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-all-samples.yml b/.github/workflows/ci-all-samples.yml index c6cef88..054a545 100644 --- a/.github/workflows/ci-all-samples.yml +++ b/.github/workflows/ci-all-samples.yml @@ -21,5 +21,5 @@ jobs: - run: echo "Starting tests" - name: Checking out repository uses: actions/checkout@v2 - - run: make -C ${{ github.workspace }} -j$(nproc) run + - run: make -C ${{ github.workspace }} -j$(sysctl -n hw.physicalcpu) run - run: echo "Tests completed"