fix(verify): gate JIT verification to amd64 until trampolines are hardened
Test / vet (push) Successful in 48s
Test / test (push) Successful in 2m34s
Test / build (push) Successful in 41s

This commit is contained in:
2026-08-30 22:48:48 +02:00
parent 9cb1666b35
commit a5a59d6503
15 changed files with 206 additions and 30 deletions
+15 -1
View File
@@ -9,6 +9,7 @@ import (
"os"
"runtime"
"sourcedock.dev/petrbalvin/gasm-devkit/arch"
"sourcedock.dev/petrbalvin/gasm-devkit/asm"
"sourcedock.dev/petrbalvin/gasm-devkit/ast"
"sourcedock.dev/petrbalvin/gasm-devkit/parser"
@@ -46,7 +47,20 @@ func LoadSource(filename, src string) (*Kernel, error) {
// LoadAST assembles a parsed AST file and maps the result into executable
// memory.
func LoadAST(file *ast.File) (*Kernel, error) {
img, err := asm.AssembleFile(file)
// Assemble with the encoder the file's name suffix calls for: the amd64
// assembler is the default, the other architectures have their own.
var img *asm.Image
var err error
switch arch.FromFilename(file.Path) {
case arch.ARM64:
img, err = asm.AssembleFileARM64(file)
case arch.RISCV:
img, err = asm.AssembleFileRISCV(file)
case arch.LOONG64:
img, err = asm.AssembleFileLOONG64(file)
default:
img, err = asm.AssembleFile(file)
}
if err != nil {
return nil, fmt.Errorf("verify: assemble: %w", err)
}