MEM-033 DONT: JABCReport casts exception OBJECT to JSStringRef (js/main.cpp)

Now
DONT

JABCReport reports a thrown JS exception. In the message branch (JSValueIsObject && has message), it fetches ref=message (a real JSStringRef) into page, overwrites the NUL with newline, then calls JSStringGetUTF8CString((JSStringRef)exception, page+len, PAGESIZE-len) but exception is a JS OBJECT, not a string. Casting an object to JSStringRef makes JSC reinterpret the object's heap layout as a StringImpl, reading a bogus length and char pointer: type confusion / OOB-garbage read into a stack buffer, reachable from any uncaught Error with a message. The sibling Stack branch correctly uses (JSStringRef)ref, confirming a copy-paste defect. The goal is to use ref, bound by remaining page, and re-terminate.

Issues

Object reinterpreted as a string; weak bounds/termination around it.

Blockers

None.

Planned

Use the message ref; bound and terminate.