[MC][PowerPC] Fix a crash when redefining a symbol after .set

Fix PR44284. This is probably not valid assembly but we should not crash.

Reviewed By: luporl, #powerpc, steven.zhang

Differential Revision: https://reviews.llvm.org/D71443
This commit is contained in:
Fangrui Song 2019-12-12 16:18:57 -08:00
parent a2cd4600ec
commit f99eedeb72
2 changed files with 7 additions and 1 deletions

View File

@ -201,7 +201,8 @@ public:
void finish() override {
for (auto *Sym : UpdateOther)
copyLocalEntry(Sym, Sym->getVariableValue());
if (Sym->isVariable())
copyLocalEntry(Sym, Sym->getVariableValue());
}
private:

View File

@ -32,3 +32,8 @@ func:
nop
nop
.localentry func, 8
## PR44284 Don't crash if err is redefined after .set
.set err, _err
.globl err
err: