JVM_IR: never create temporaries in $default stubs

Given the strict pattern-matching in the inliner, this is the only way
to make it not crash when attempting to inline these stubs. Note that
the IR backend does not currently use the inliner's default method stub
handling; the crash only occurs when a module compiled with the non-IR
JVM backend is attempting to call an inline function with default
arguments defined in a module that was compiled with the IR backend.
This commit is contained in:
pyos
2019-10-16 13:23:57 +02:00
committed by max-kammerer
parent 95be7171bc
commit 55acc296a2
13 changed files with 136 additions and 19 deletions
@@ -0,0 +1,6 @@
inline fun f(x: Int = 1) = x
// MUST contain these instructions to avoid breaking the inliner.
// See `expandMaskConditionsAndUpdateVariableNodes`.
// 1 ILOAD 1\s*ICONST_1\s*IAND\s*IFEQ L1
// 1 ICONST_1\s*ISTORE 0\s*(L\d\s*)*L1