Skip to content

fix(cl): nodeInterp.LoadExpr - #1114

Merged
xushiwei merged 3 commits into
goplus:mainfrom
xushiwei:q
Oct 27, 2026
Merged

xushiwei merged 3 commits into
goplus:mainfrom
xushiwei:q

Conversation

@xushiwei

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.09%. Comparing base (1afd686) to head (ac38380).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1114      +/-   ##
==========================================
+ Coverage   86.29%   91.09%   +4.79%     
==========================================
  Files          26       26              
  Lines        3459     3480      +21     
==========================================
+ Hits         2985     3170     +185     
+ Misses        474      310     -164     
Flag Coverage Δ
llgo-tests 91.09% <100.00%> (+4.79%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a focused, well-scoped change: it implements the previously-stubbed nodeInterp.LoadExpr, seeds the INT_MAX built-in macro (c_INT_MAX), threads source-position nodes through the auto-macro-func codegen, and adds debugMacroFunc logging. cl/... builds cleanly.

Verified correct: c_INT_MAX = (1 << (unsafe.Sizeof(c.Int(0))*8 - 1)) - 1 evaluates to 2147483647 (c.Int is a fixed int32 in goplus/lib), a platform-independent untyped constant that boxes into any as int. The testdata lines up: LUA_REGISTRYINDEX = -(INT_MAX/2 + 1000) = -1073742823, matching cl/_testc/lua/out.go, and lua_getfield -> Getfield is consistent with in.h. The pointer->value nodeInterp receiver and the removal of the unused fset field are behavior-preserving (the impl now reaches the fileset via v.ctx). The macrofunc.go node threading is sound (all builder methods take src ...ast.Node; goNode returns a true nil, so there is no typed-nil pitfall).

Worth addressing before merge: LoadExpr now runs for real (previously it was a panic("todo") stub), and both its failure modes are fatal because the auto-macro-func codegen runs in a post-unit with no recover (gogen's default HandleErr panics). See the inline comment on LoadExpr. The other items are minor (memory retention, naming, stale TODO).

Comment thread cl/ctx.go Resolved
Comment thread cl/ctx.go Resolved
Comment thread cl/ctx.go Resolved
Comment thread cl/compile.go Resolved
@xushiwei
xushiwei merged commit d592961 into goplus:main Oct 27, 2026
4 checks passed
@xushiwei
xushiwei deleted the q branch October 28, 2026 02:35
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.

1 participant