Add reproducer of Binaryen bug

This commit is contained in:
Iaroslav Postovalov 2020-11-11 21:20:53 +07:00
parent 68f7019304
commit ca219fa91b
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7

View File

@ -63,7 +63,7 @@ internal sealed class WasmBuilder<T>(val binaryenType: Type, val kmathAlgebra: A
) )
setOptimizeLevel(3) setOptimizeLevel(3)
// optimizeFunction("executable") optimizeFunction("executable")
addFunctionExport("executable", "executable") addFunctionExport("executable", "executable")
val res = emitBinary() val res = emitBinary()
dispose() dispose()
@ -74,7 +74,7 @@ internal sealed class WasmBuilder<T>(val binaryenType: Type, val kmathAlgebra: A
val i = Instance(c, js("{}") as Any) val i = Instance(c, js("{}") as Any)
return Expression { args -> return Expression { args ->
val params = keys.map { StringSymbol(it) }.map { args.getValue(it) }.toTypedArray() val params = keys.map(::StringSymbol).map(args::getValue).toTypedArray()
keys.clear() keys.clear()
spreader(i.exports.asDynamic().executable, params) as T spreader(i.exports.asDynamic().executable, params) as T
} }