Skip to content

Conversation

@aviatesk
Copy link
Member

@aviatesk aviatesk commented Dec 8, 2025

When lookup_stmt encounters a Base.getproperty call pattern (used for llvmcall detection) it attempts to resolve intermediate GlobalRefs. Previously, it called getglobal without checking if the global was actually defined, causing UndefVarError when processing code in modules where the referenced global doesn't exist.

This is problematic for tools like JET that analyze code in virtual modules where globals may not be necessarily defined.

The fix adds an isdefinedglobal check before calling getglobal, consistent with the existing check at lines 27-28 for the final property lookup.

When `lookup_stmt` encounters a `Base.getproperty` call pattern (used
for llvmcall detection) it attempts to resolve intermediate
`GlobalRef`s. Previously, it called `getglobal` without checking if the
global was actually defined, causing `UndefVarError` when processing
code in modules where the referenced global doesn't exist.

This is problematic for tools like JET that analyze code in virtual
modules where globals may not be necessarily defined.

The fix adds an `isdefinedglobal` check before calling `getglobal`,
consistent with the existing check at lines 27-28 for the final property
lookup.
@aviatesk aviatesk merged commit 58de936 into master Dec 8, 2025
9 of 10 checks passed
@aviatesk aviatesk deleted the avi/fix-lookup_stmt branch December 8, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants