Skip to content

v0.12.0 - VM Panic Handler

Choose a tag to compare

@kirisaki kirisaki released this 04 Nov 18:46
· 24 commits to main since this release

🚨 VM Panic Handler System

This release adds a comprehensive panic handler system for debugging and diagnostics.

✨ New Features

  • vm_panic() API: Automatic error diagnostics with stack trace
  • Panic Information Structures: (C) and (C++)
  • Comprehensive Diagnostic Output:
    • Error code with human-readable message
    • Program Counter (PC) value
    • Data Stack depth and top 2 elements (TOS, NOS)
    • Return Stack depth with call trace (up to 16 entries)

🔧 Implementation Details

  • All error paths in VM core integrated with panic handler
  • Stack operations (push/pop) automatically log on overflow/underflow
  • Opcode errors (div-by-zero, invalid jumps, etc.) logged automatically
  • 5 comprehensive test cases covering all panic scenarios

📊 Size Impact

  • Library size increase: ~2KB (182KB stripped with LTO)
  • Minimal impact in final applications due to LTO optimization
  • Unused panic code eliminated at link time

🧪 Testing

All 11 tests passing, including 5 new panic handler tests.


Full Changelog: v0.11.1...v0.12.0