summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-12-11 14:22:36 -0500
committerPeter Zhu <[email protected]>2024-12-12 14:07:56 -0500
commitca2d19d4e5a47822c250179f88c814c5f401e9bd (patch)
treec8eaba4f85561bb5ef7fd11008dcb598105d7d0a /error.c
parentc0caf1cc1aaa3ba2e9d09977ee2a51e35114c70f (diff)
Implement rb_bug_without_die
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12309
Diffstat (limited to 'error.c')
-rw-r--r--error.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/error.c b/error.c
index 88b8a0653e..59c6fa7dd6 100644
--- a/error.c
+++ b/error.c
@@ -1085,7 +1085,7 @@ die(void)
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 1, 0)
static void
-rb_bug_without_die(const char *fmt, va_list args)
+rb_bug_without_die_internal(const char *fmt, va_list args)
{
const char *file = NULL;
int line = 0;
@@ -1098,11 +1098,20 @@ rb_bug_without_die(const char *fmt, va_list args)
}
void
+rb_bug_without_die(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ rb_bug_without_die_internal(fmt, args);
+ va_end(args);
+}
+
+void
rb_bug(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- rb_bug_without_die(fmt, args);
+ rb_bug_without_die_internal(fmt, args);
va_end(args);
die();
}