From 09899ec5eca47a076a8cfdfc954fa9b44b2eda9c Mon Sep 17 00:00:00 2001 From: "xiangxing.wu" Date: Mon, 18 May 2026 16:29:09 +0800 Subject: [PATCH] arm: handle unparseable instructions in recompileExceptionClearForArm Align with the arm64 implementation by catching Instruction.parse() failures during block discovery. On some Android 14 ARM32 devices, branch targets in ExceptionClear lead to compiler-inserted padding (e.g. UDF traps after __stack_chk_fail) that cannot be parsed, causing "Error: invalid instruction" and preventing Java bridge initialization. Fixes: frida/frida#3567 --- lib/android.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/android.js b/lib/android.js index 11daebe..017402d 100644 --- a/lib/android.js +++ b/lib/android.js @@ -4543,7 +4543,16 @@ function recompileExceptionClearForArm (buffer, pc, exceptionClearImpl, nextFunc break; } - const insn = Instruction.parse(current); + let insn; + try { + insn = Instruction.parse(current); + } catch (e) { + if (lastInsn !== null) { + reachedEndOfBlock = true; + break; + } + throw e; + } const { mnemonic } = insn; lastInsn = insn;