ssa: binop check shl/shr

This commit is contained in:
visualfc
2024-05-16 15:09:00 +08:00
parent 07e55c3d89
commit 98945926ca
6 changed files with 212 additions and 14 deletions

15
internal/runtime/error.go Normal file
View File

@@ -0,0 +1,15 @@
package runtime
type errorString string
func (e errorString) RuntimeError() {}
func (e errorString) Error() string {
return "runtime error: " + string(e)
}
func CheckRuntimeError(b bool, s string) {
if b {
panic(errorString(s).Error())
}
}