aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCExpr.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-05-26 13:05:20 -0700
committerFangrui Song <i@maskray.me>2025-05-26 13:05:20 -0700
commit27b6ba449b9570049d9aa9ef81cac465cdec2934 (patch)
treeaf537d4a33b2c2b1895d3ddda8a345458cb28c7c /llvm/lib/MC/MCExpr.cpp
parent73c49293220bb36e430d9c840568d45c886bd2ab (diff)
downloadllvm-27b6ba449b9570049d9aa9ef81cac465cdec2934.zip
llvm-27b6ba449b9570049d9aa9ef81cac465cdec2934.tar.gz
llvm-27b6ba449b9570049d9aa9ef81cac465cdec2934.tar.bz2
MC: Improve error reporting for equated symbols and undefined labels
Currently, the code path is likely only reachable with super edge-case scenario, but will be more reachable with the upcoming parseAssignmentExpression improvement to address a pile of hacks.
Diffstat (limited to 'llvm/lib/MC/MCExpr.cpp')
-rw-r--r--llvm/lib/MC/MCExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index e0948de..eef6965 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -538,6 +538,8 @@ bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
// Allows aliases with zero offset.
if (Res.getConstant() == 0 && (!A || !B))
return true;
+ } else {
+ return false;
}
}