Fix crash with function declarations with unnamed parameters.
Fixes issue #103. Previously, we were inadvertently grabbing the function's return type for the parameter, rather than the actual parameter type.
This commit is contained in:
2
decl.cpp
2
decl.cpp
@@ -237,7 +237,7 @@ Declarator::GetType(DeclSpecs *ds) const {
|
||||
sprintf(buf, "__anon_parameter_%d", i);
|
||||
sym = new Symbol(buf, pos);
|
||||
Declarator *declarator = new Declarator(sym, sym->pos);
|
||||
sym->type = declarator->GetType(ds);
|
||||
sym->type = declarator->GetType(d->declSpecs);
|
||||
d->declarators.push_back(declarator);
|
||||
}
|
||||
else {
|
||||
|
||||
1
type.cpp
1
type.cpp
@@ -1833,6 +1833,7 @@ FunctionType::LLVMFunctionType(llvm::LLVMContext *ctx, bool includeMask) const {
|
||||
for (unsigned int i = 0; i < argTypes.size(); ++i) {
|
||||
if (!argTypes[i])
|
||||
return NULL;
|
||||
assert(argTypes[i] != AtomicType::Void);
|
||||
|
||||
LLVM_TYPE_CONST llvm::Type *t = argTypes[i]->LLVMType(ctx);
|
||||
if (!t)
|
||||
|
||||
Reference in New Issue
Block a user