mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Debug info with recursive canonical type usage could cause segfault.
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
- Assert not properly traced #1354.
|
||||
- Ordering issues with `$include` / `$exec` fixed #1302.
|
||||
- Issues with wincrt linking.
|
||||
- Debug info with recursive canonical type usage could cause segfault.
|
||||
|
||||
### Stdlib changes
|
||||
|
||||
|
||||
@@ -604,7 +604,7 @@ static void gencontext_verify_ir(GenContext *context)
|
||||
{
|
||||
if (*error)
|
||||
{
|
||||
puts("IR integrity failure.");
|
||||
eprintf("----------------------------------IR integrity failure:\n");
|
||||
LLVMDumpModule(context->module);
|
||||
error_exit("Could not verify IR: %s", error);
|
||||
}
|
||||
@@ -1511,9 +1511,9 @@ void **llvm_gen(Module** modules, unsigned module_count)
|
||||
}
|
||||
for (unsigned i = 0; i < module_count; i++)
|
||||
{
|
||||
GenContext *result = llvm_gen_module(modules[i], NULL);
|
||||
if (!result) continue;
|
||||
vec_add(gen_contexts, result);
|
||||
GenContext *result = llvm_gen_module(modules[i], NULL);
|
||||
if (!result) continue;
|
||||
vec_add(gen_contexts, result);
|
||||
}
|
||||
if (compiler.build.benchmarking)
|
||||
{
|
||||
|
||||
@@ -569,11 +569,9 @@ static LLVMMetadataRef llvm_debug_func_type(GenContext *c, Type *type)
|
||||
|
||||
static inline LLVMMetadataRef llvm_get_debug_type_internal(GenContext *c, Type *type, LLVMMetadataRef scope)
|
||||
{
|
||||
if (type->backend_debug_type) return type->backend_debug_type;
|
||||
Type *canonical = type->canonical;
|
||||
if (canonical != type)
|
||||
if (type->backend_debug_type)
|
||||
{
|
||||
return type->backend_debug_type = llvm_get_debug_type(c, canonical);
|
||||
return type->backend_debug_type;
|
||||
}
|
||||
// Consider special handling of UTF8 arrays.
|
||||
switch (type->type_kind)
|
||||
|
||||
Reference in New Issue
Block a user