Skip to content

Commit

Permalink
Merge pull request #88 from AjayBrahmakshatriya/master
Browse files Browse the repository at this point in the history
Fixed bug with parents_stack being static
  • Loading branch information
AjayBrahmakshatriya authored Dec 12, 2024
2 parents c74cd27 + ab97219 commit ceefecf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-all-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion include/builder/dyn_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ struct custom_type : custom_type_base {
}
};

static std::vector<var *> *parents_stack = nullptr;
extern std::vector<var *> *parents_stack;

// Struct to initialize a dyn_var as member;
struct as_member {
var *parent_var;
Expand Down
2 changes: 2 additions & 0 deletions src/builder/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace options {
bool track_members = false;
}

std::vector<var *> *parents_stack = nullptr;

template <>
std::vector<block::type::Ptr> extract_type_vector_dyn<>(void) {
std::vector<block::type::Ptr> empty_vector;
Expand Down
5 changes: 5 additions & 0 deletions src/builder/builder_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ceefecf

Please sign in to comment.