Project

General

Profile

Backport #7982 » t.c

test extension to segfault - erik.s.chang (Erik Chang), 02/28/2013 09:50 AM

 
#include <ruby.h>

static VALUE blowup(VALUE self, VALUE val)
{
LONG_LONG tmp = NUM2LL(val);
const char *s = "HI";

rb_raise(rb_eRangeError, "%s: %lli", s, tmp);

return self;
}

void Init_t(void)
{
rb_define_method(rb_cString, "blowup", blowup, 1);
}
(1-1/2)