Skip to content

Commit 71ccd0d

Browse files
authored
[IRInterpreter] Return zero address for missing weak function (#93548)
If a weak function is missing, still return it's address (zero) rather than failing interpretation. Otherwise we have a mismatch between Interpret() and CanInterpret() resulting in failures that would not occur with JIT execution. Alternatively, we could try to look for weak symbols in CanInterpret() and generally reject them there. This is the root cause for the issue exposed by #92885. Previously, the case affected by that always fell back to JIT because an icmp constant expression was used, which is not supported by the interpreter. Now a normal icmp instruction is used, which is supported. However, we fail to interpret due to incorrect handling of weak function addresses.
1 parent 089dfee commit 71ccd0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Expression/IRInterpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class InterpreterStackFrame {
264264
lldb_private::ConstString name(constant_func->getName());
265265
bool missing_weak = false;
266266
lldb::addr_t addr = m_execution_unit.FindSymbol(name, missing_weak);
267-
if (addr == LLDB_INVALID_ADDRESS || missing_weak)
267+
if (addr == LLDB_INVALID_ADDRESS)
268268
return false;
269269
value = APInt(m_target_data.getPointerSizeInBits(), addr);
270270
return true;

0 commit comments

Comments
 (0)