You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compile to JVM with asmble, it fails:
Caused by: java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.last(_Collections.kt:360)
at asmble.io.BinaryToAst.toModule(BinaryToAst.kt:216)
at asmble.cli.Translate.inToAst(Translate.kt:70)
at asmble.cli.Compile.run(Compile.kt:54)
This was working with version 0.3.0 but broke in 0.4.0.
This is the code that fails, where you call customSections.last():
if (sectionId != 0) customSections else {
// If the last section was custom, use the last custom section's after-ID,
// otherwise just use the last section ID
val afterSectionId = if (index == 0) 0 else sections[index - 1].let { (prevSectionId, _) ->
if (prevSectionId == 0) customSections.last().afterSectionId else prevSectionId
}
This code is hard to follow, but looks like customSection starts off empty, so it's likely the last() call is going to be called on the empty list, as is happening to me. Not sure what afterSectionId should be assigned to in that case though, hope you can help find a solution.
The text was updated successfully, but these errors were encountered:
I've got
clang
to compile this to WASM:When trying to compile to JVM with asmble, it fails:
This was working with version 0.3.0 but broke in 0.4.0.
This is the code that fails, where you call
customSections.last()
:This code is hard to follow, but looks like
customSection
starts off empty, so it's likely thelast()
call is going to be called on the empty list, as is happening to me. Not sure whatafterSectionId
should be assigned to in that case though, hope you can help find a solution.The text was updated successfully, but these errors were encountered: