fix(arm64): reject bare BTI with a diagnostic and accept the full family
Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -2856,8 +2856,14 @@ func encodeARM64Sys(mnem string, ops []*ast.Operand) ([]byte, error) {
|
||||
}
|
||||
return a64wordLE(0xd503201f | uint32(v)<<5), nil
|
||||
case "BTI":
|
||||
// The toolchain requires the landing-pad kind: bare BTI is
|
||||
// rejected ("missing operand"), and only the uppercase C/J/JC
|
||||
// spellings assemble (0xd503245f/49f/4df).
|
||||
if len(ops) != 1 {
|
||||
return nil, fmt.Errorf("%s expects C, J, or JC", mnem)
|
||||
}
|
||||
op := operandRegName(ops[0])
|
||||
base, ok := map[string]uint32{"C": 0xd503245f}[op]
|
||||
base, ok := map[string]uint32{"C": 0xd503245f, "J": 0xd503249f, "JC": 0xd50324df}[op]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("%s: unknown kind %q", mnem, op)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user