Commit 8044a10
committed
fix: add loadfile to Lua eval-detection guard in both engines (#2043)
Greptile flagged that loadfile is listed in LUA_BUILTIN_GLOBALS alongside
load/loadstring/dofile and performs the same dynamic-code-loading operation,
but was missing from the eval-detection guard in both the WASM extractor
(src/extractors/lua.ts) and the native Rust extractor
(crates/codegraph-core/src/extractors/lua.rs) — so loadfile("script.lua")()
was not flagged as a dynamic eval site on either engine.
Since this PR's purpose is eliminating WASM/native divergence for Lua
eval/computed-key detection, fixing loadfile on only one engine would
reintroduce exactly the kind of parity gap this PR exists to close. Adds
loadfile to the guard on both sides plus a unit test on each (mirroring the
existing load/loadstring/dofile coverage).
Impact: 1 functions changed, 2 affected1 parent 3df0ac4 commit 8044a10
3 files changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
389 | 398 | | |
390 | 399 | | |
391 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
| |||
0 commit comments