error.c: call va_end
before jumping
The man page is clear that every `va_start` call MUST be succeeded by the corresponding `va_end` call. So `rb_raise` can't call `rb_exc_raise` before `va_end`, otherwise `va_end` is never called. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
This commit is contained in:
parent
1d510a952d
commit
cedcf2d681
5
error.c
5
error.c
@ -3632,12 +3632,13 @@ rb_vraise(VALUE exc, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_raise(VALUE exc, const char *fmt, ...)
|
rb_raise(VALUE exc_class, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
rb_vraise(exc, fmt, args);
|
VALUE exc = rb_exc_new3(exc_class, rb_vsprintf(fmt, args));
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
rb_exc_raise(exc);
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN(static void raise_loaderror(VALUE path, VALUE mesg));
|
NORETURN(static void raise_loaderror(VALUE path, VALUE mesg));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user