MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / __assert_fail__

Method __assert_fail__

src/core/impl/common.cpp:317–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void mgb::__assert_fail__(
318 const char* file, int line, const char* func, const char* expr,
319 const char* msg_fmt, ...) {
320 std::string msg =
321 ssprintf("assertion `%s' failed at %s:%d: %s", expr, file, line, func);
322 if (msg_fmt) {
323 msg_fmt = convert_fmt_str(msg_fmt);
324 va_list ap;
325 va_start(ap, msg_fmt);
326 msg.append("\nextra message: ");
327 msg.append(svsprintf(msg_fmt, ap));
328 va_end(ap);
329 }
330 mgb_throw_raw(AssertionError{msg});
331}
332
333#if MGB_ENABLE_LOGGING && !MGB_ENABLE_EXCEPTION
334void mgb::__on_exception_throw__(const std::exception& exc) {

Callers

nothing calls this directly

Calls 3

convert_fmt_strFunction · 0.85
svsprintfFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected