diff options
| author | merry <git@mary.rs> | 2022-03-04 22:16:58 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-04 23:16:58 +0100 |
| commit | 497199bb50af98a73e0862107f408757a6e8da31 (patch) | |
| tree | 21d2c51defa75253f2ff4e56d1027c8cdf56cf14 /ARMeilleure/Decoders/Decoder.cs | |
| parent | bd9ac0fdaadd233e778a872c48f7f628b5a68c93 (diff) | |
Decoder: Exit on trapping instructions, and resume execution at trapping instruction (#3153)
* Decoder: Exit on trapping instructions, and resume execution at trapping instruction
* Resume at trapping address
* remove mustExit
Diffstat (limited to 'ARMeilleure/Decoders/Decoder.cs')
| -rw-r--r-- | ARMeilleure/Decoders/Decoder.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ARMeilleure/Decoders/Decoder.cs b/ARMeilleure/Decoders/Decoder.cs index af3b0629..4dd8742c 100644 --- a/ARMeilleure/Decoders/Decoder.cs +++ b/ARMeilleure/Decoders/Decoder.cs @@ -121,7 +121,7 @@ namespace ARMeilleure.Decoders currBlock.Branch = GetBlock((ulong)op.Immediate); } - if (!IsUnconditionalBranch(lastOp) || isCall) + if (isCall || !(IsUnconditionalBranch(lastOp) || IsTrap(lastOp))) { currBlock.Next = GetBlock(currBlock.EndAddress); } @@ -330,8 +330,12 @@ namespace ARMeilleure.Decoders private static bool IsException(OpCode opCode) { + return IsTrap(opCode) || opCode.Instruction.Name == InstName.Svc; + } + + private static bool IsTrap(OpCode opCode) + { return opCode.Instruction.Name == InstName.Brk || - opCode.Instruction.Name == InstName.Svc || opCode.Instruction.Name == InstName.Trap || opCode.Instruction.Name == InstName.Und; } |
