| 277 | } |
| 278 | |
| 279 | void GjsCallbackTrampoline::warn_about_illegal_js_callback(const char* when, |
| 280 | const char* reason, |
| 281 | bool dump_stack) { |
| 282 | std::ostringstream message; |
| 283 | |
| 284 | message << "Attempting to run a JS callback " << when << ". " |
| 285 | << "This is most likely caused by " << reason << ". " |
| 286 | << "Because it would crash the application, it has been blocked.\n" |
| 287 | << "The offending callback was " << m_info.name() << "()" |
| 288 | << (m_is_vfunc ? ", a vfunc." : "."); |
| 289 | |
| 290 | if (dump_stack) { |
| 291 | message << "\n" << gjs_dumpstack_string(); |
| 292 | } |
| 293 | g_critical("%s", message.str().c_str()); |
| 294 | } |
| 295 | |
| 296 | /* This is our main entry point for ffi_closure callbacks. ffi_prep_closure() is |
| 297 | * doing pure magic and replaces the original function call with this one which |
nothing calls this directly
no test coverage detected