Commit 4df540c
committed
Carry type arguments through the vararg call redirects
Both redirects rebuilt the call with an empty ImTypeArguments. That was right
on Jass, where EliminateGenerics runs at phase 2 and nothing generic survives
to the vararg phase, but it is an assumption about the pipeline written into
a node constructor, and Lua reaches this pass with a different amount erased.
Measured before changing anything, since the reported failure is a strong
claim: a probe that threw whenever either redirect saw a non-empty type
argument list found no hit anywhere in LuaBackendAuditTests, VarargTests,
GenericsTests, LuaTranslationTests, GenericsWithTypeclassesTests or
StdLibOwnTests. A generic vararg returning its type parameter, consumed by
string concatenation, also produces the correct string without this change.
So the reported miscompilation does not occur: Lua erases these before the
pass rather than carrying them into it.
The list is moved across anyway. It costs nothing, it is a no-op while the
list is empty, and rebuilding a call should copy what the call had instead of
restating a fact about phase order that only holds on one target.1 parent 2dbba0c commit 4df540c
2 files changed
Lines changed: 32 additions & 2 deletions
File tree
- de.peeeq.wurstscript/src
- main/java/de/peeeq/wurstscript/translation/imtranslation
- test/java/tests/wurstscript/tests
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2129 | 2129 | | |
2130 | 2130 | | |
2131 | 2131 | | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
2132 | 2155 | | |
2133 | 2156 | | |
2134 | 2157 | | |
| |||
0 commit comments