NationalSecurityAgency/ghidra · info · AssemblySemanticException

No match found

Error message

No match found

What it means

Thrown by AssemblyThrasherDevScript's AllMatchByTextSelector.select when no candidate encoding produced by the assembler round-trips to the same instruction text as the original. For each resolved pattern it disassembles the candidate bytes and compares toString(); if none equal the expected text, AssemblySemanticException("No match found") is raised. This is an internal assembler test/diagnostic, not a user-facing API - it signals that the Sleigh assembler failed to reproduce a disassembled instruction.

Source

Thrown at Ghidra/Features/Base/ghidra_scripts/AssemblyThrasherDevScript.java:92

				}
				AssemblyResolvedPatterns can = (AssemblyResolvedPatterns) ar;
				if (can.getContext().combine(ctx) == null) {
					continue;
				}
				for (byte[] ins : can.possibleInsVals(ctx)) {
					String cantext = disassemble(orig, ins).toString().trim();
					if (cantext.equals(text)) {
						gotOne = true;
					}
					else {
						sb.append("Mismatch: " + NumericUtilities.convertBytesToString(ins) +
							" => " + cantext + ". ");
						failedOne = true;
					}
				}
			}
			if (!gotOne) {
				throw new AssemblySemanticException("No match found");
			}
			if (failedOne) {
				throw new AssemblySemanticException(sb.toString());
			}
			// Don't return, to avoid modifying the binary.
			throw new Accept();
		}
	}

	@Override
	protected void run() throws Exception {
		clearBackgroundColor(currentProgram.getMemory().getAllInitializedAddressSet());

		BookmarkManager bm = currentProgram.getBookmarkManager();
		Icon myIcon = Icons.WARNING_ICON;
		bm.defineType(BOOKMARK_FAIL, myIcon, Palette.YELLOW, 0);
		bm.removeBookmarks(BOOKMARK_FAIL);

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Treat this as expected output: the script catches AssemblySemanticException and records a 'Semantic Error' bookmark - inspect the bookmark, not the exception.
  2. Improve the Sleigh language definition for the failing instruction (the mismatch is logged).
  3. If developing the assembler, run with the SleighDebugLogger to identify which constructor tree failed.
  4. Skip instructions known to be non-round-trippable rather than failing the script.

Example fix

// before - the selector throws inside asm.assemble(...)
try {
    asm.assemble(ins.getAddress(), ins.toString());
} catch (AssemblySemanticException e) {
    // 'No match found' lands here
}

// after - the script already handles it; just record and continue
bm.setBookmark(ins.getAddress(), BOOKMARK_FAIL, "Semantic Error", e.getMessage());
// no code change needed; the throw is the script's signal path
Defensive patterns

Strategy: try-catch

Try / catch

try {
    asm.assemble(ins.getAddress(), ins.toString());
} catch (AssemblySemanticException e) {
    // expected signal of a non-round-trippable instruction
    bm.setBookmark(ins.getAddress(), BOOKMARK_FAIL, "Semantic Error", e.getMessage());
}

Prevention

When it happens

Trigger: Running AssemblyThrasherDevScript against a program where the assembler cannot reconstruct an instruction's bytes from its text. Triggered when the instruction's displayed text includes context-dependent tokens the assembler cannot resolve, or when the Sleigh specification has gaps.

Common situations: Developing or upgrading a Sleigh language module. Running the thrasher against an unusual architecture variant. Encountering instructions whose rendering depends on context not captured by the assembler.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/eae1cc83c9b3bf29. Report an issue: GitHub.