mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-24 09:29:42 +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))
|
||||
return false;
|
||||
|
||||
// Absolutize symbol differences when we have a layout object and the
|
||||
// target requests it.
|
||||
// Absolutize symbol differences between defined symbols when we have a
|
||||
// layout object and the target requests it.
|
||||
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 &B = Layout->getAssembler().getSymbolData(*Res.getSymB());
|
||||
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: Set associated section.
|
||||
Symbol->setValue(Value);
|
||||
Symbol->setValue(AddValueSymbols(Value));
|
||||
}
|
||||
|
||||
void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
|
||||
|
Loading…
Reference in New Issue
Block a user