mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Creating recursive debug info for functions could cause assertions.
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
- Crash when doing a type property lookup for const inline enums in some cases #2717.
|
||||
- Incorrect alignment on typedef and local variable debug info.
|
||||
- Assert on optional-returning-function in a comma expression. #2722
|
||||
- Creating recursive debug info for functions could cause assertions.
|
||||
|
||||
### Stdlib changes
|
||||
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
||||
|
||||
@@ -587,21 +587,25 @@ static LLVMMetadataRef llvm_debug_func_type(GenContext *c, Type *type)
|
||||
if (type->backend_debug_type) return type->backend_debug_type;
|
||||
|
||||
// 3. Otherwise generate:
|
||||
static LLVMMetadataRef *buffer = NULL;
|
||||
vec_resize(buffer, 0);
|
||||
vec_add(buffer, llvm_get_debug_type(c, typeget(sig->rtype)));
|
||||
LLVMMetadataRef params[MAX_PARAMS + 1];
|
||||
int index = 0;
|
||||
params[index++] = llvm_get_debug_type(c, typeget(sig->rtype));
|
||||
FOREACH(Decl *, param, sig->params)
|
||||
{
|
||||
vec_add(buffer, llvm_get_debug_type(c, param->type));
|
||||
params[index++] = llvm_get_debug_type(c, param->type);
|
||||
}
|
||||
if (prototype->raw_variadic)
|
||||
{
|
||||
vec_add(buffer, LLVMDIBuilderCreateUnspecifiedType(c->debug.builder, "", 0));
|
||||
params[index++] = LLVMDIBuilderCreateUnspecifiedType(c->debug.builder, "", 0);
|
||||
}
|
||||
|
||||
// 4. We might be done again!
|
||||
if (type->backend_debug_type) return type->backend_debug_type;
|
||||
|
||||
return LLVMDIBuilderCreateSubroutineType(c->debug.builder,
|
||||
c->debug.file.debug_file,
|
||||
buffer,
|
||||
vec_size(buffer), 0);
|
||||
params,
|
||||
index, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user