-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace i31 stack result fun with exception variant
- Loading branch information
1 parent
dde3162
commit a1837b0
Showing
7 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
...rc/commonMain/kotlin/io/github/charlietap/chasm/executor/runtime/ext/ReferenceValueExt.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...internal/src/commonMain/kotlin/io/github/charlietap/chasm/executor/runtime/ext/UIntExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.charlietap.chasm.executor.runtime.ext | ||
|
||
inline fun UInt.extendSigned(): Int { | ||
val signBit = 1 shl 30 | ||
return if ((this and signBit.toUInt()) != 0u) { | ||
this.toInt() or (Int.MIN_VALUE) | ||
} else { | ||
this.toInt() | ||
} | ||
} | ||
|
||
inline fun UInt.extendUnsigned(): Int = this.toInt() |