Skip to content

Infinite call to gen_destructor #105

@raffopazzo

Description

@raffopazzo

I have lost the test case now but gen_destructor_call() in

static void gen_destructor_call(
global_ctx_t& global,
local_ctx_t& local,
llvm::IRBuilder<>& builder,
llvm::Value* const value,
typecheck::expr_t const& type)
{
auto destructor = global.get_destructor(type);
if (not destructor)
{
destructor = gen_destructor(global, type);
global.store_destructor(type, *destructor);
}
if (auto const properties = get_properties_if_array(type))
{
auto const size = gen_array_total_size(global, local, builder, *properties);
auto const call = builder.CreateCall(destructor->type, destructor->func, {value, size});
call->addParamAttr(1, llvm::Attribute::ZExt);
}
else
builder.CreateCall(destructor->type, destructor->func, {value});
}
may end up in an infinite recursion calling itself. I think the test was involving a tree, which is not surprising since deleting a node requires deleting its nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions