mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
Fix coredump for when an ID is used illegally outside a record
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7411 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfce056ea8
commit
18226e0cf1
@ -245,6 +245,10 @@ Value : INTVAL {
|
||||
$$ = Init;
|
||||
delete $2;
|
||||
} | ID {
|
||||
if (CurRec == 0) {
|
||||
err() << "Def/Class name '" << *$1 << "' not allowed here!\n";
|
||||
abort();
|
||||
}
|
||||
if (const RecordVal *RV = CurRec->getValue(*$1)) {
|
||||
$$ = new VarInit(*$1, RV->getType());
|
||||
} else if (Record *D = Records.getDef(*$1)) {
|
||||
|
@ -245,6 +245,10 @@ Value : INTVAL {
|
||||
$$ = Init;
|
||||
delete $2;
|
||||
} | ID {
|
||||
if (CurRec == 0) {
|
||||
err() << "Def/Class name '" << *$1 << "' not allowed here!\n";
|
||||
abort();
|
||||
}
|
||||
if (const RecordVal *RV = CurRec->getValue(*$1)) {
|
||||
$$ = new VarInit(*$1, RV->getType());
|
||||
} else if (Record *D = Records.getDef(*$1)) {
|
||||
|
Loading…
Reference in New Issue
Block a user