Root cause: Tools were unsafely casting compilationInfo.asm to string when
it could be ParsedAsmResultLine[] or undefined, causing runtime crashes
when splitLines() tried to call .split() on non-string values.
Changes:
- Add extractTextLines() helper to safely extract text from union types
- Add normalizeAsmToString() helper to convert asm data to string for parsers
- Fix 3 tools using unsafe casts: osaca-tool, x86to6502-tool, llvm-mca-tool
- Add proper null checks and error handling for missing assembly data
- Remove unnecessary else clauses per linter suggestions
This eliminates the root cause of "text.split is not a function" errors
while maintaining clean separation between string processing and type handling.
Fixes COMPILER-EXPLORER-C2N
Fixes COMPILER-EXPLORER-AWW
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>