mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
MC: Fix a crash on invalid, attempting to evaluate undefined symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7561d48095
commit
d3da36286f
@ -195,10 +195,11 @@ bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
|
|||||||
if (!Sym.getValue()->EvaluateAsRelocatable(Res, Layout))
|
if (!Sym.getValue()->EvaluateAsRelocatable(Res, Layout))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Absolutize symbol differences when we have a layout object and the
|
// Absolutize symbol differences between defined symbols when we have a
|
||||||
// target requests it.
|
// layout object and the target requests it.
|
||||||
if (Layout && Res.getSymB() &&
|
if (Layout && Res.getSymB() &&
|
||||||
Layout->getAssembler().getBackend().hasAbsolutizedSet()) {
|
Layout->getAssembler().getBackend().hasAbsolutizedSet() &&
|
||||||
|
Res.getSymA()->isDefined() && Res.getSymB()->isDefined()) {
|
||||||
MCSymbolData &A = Layout->getAssembler().getSymbolData(*Res.getSymA());
|
MCSymbolData &A = Layout->getAssembler().getSymbolData(*Res.getSymA());
|
||||||
MCSymbolData &B = Layout->getAssembler().getSymbolData(*Res.getSymB());
|
MCSymbolData &B = Layout->getAssembler().getSymbolData(*Res.getSymB());
|
||||||
Res = MCValue::get(+ A.getFragment()->getAddress() + A.getOffset()
|
Res = MCValue::get(+ A.getFragment()->getAddress() + A.getOffset()
|
||||||
|
@ -184,7 +184,7 @@ void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
|
|||||||
|
|
||||||
// FIXME: Lift context changes into super class.
|
// FIXME: Lift context changes into super class.
|
||||||
// FIXME: Set associated section.
|
// FIXME: Set associated section.
|
||||||
Symbol->setValue(Value);
|
Symbol->setValue(AddValueSymbols(Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
|
void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
|
||||||
|
Loading…
Reference in New Issue
Block a user