summaryrefslogtreecommitdiff
path: root/ext/psych/psych_to_ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/psych_to_ruby.c')
-rw-r--r--ext/psych/psych_to_ruby.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/psych/psych_to_ruby.c b/ext/psych/psych_to_ruby.c
index b388ff7754..3ab0138b52 100644
--- a/ext/psych/psych_to_ruby.c
+++ b/ext/psych/psych_to_ruby.c
@@ -10,7 +10,11 @@ static VALUE build_exception(VALUE self, VALUE klass, VALUE mesg)
{
VALUE e = rb_obj_alloc(klass);
+#ifdef TRUFFLERUBY
+ rb_exc_set_message(e, mesg);
+#else
rb_iv_set(e, "mesg", mesg);
+#endif
return e;
}
@@ -36,4 +40,3 @@ void Init_psych_to_ruby(void)
rb_define_private_method(cPsychVisitorsToRuby, "build_exception", build_exception, 2);
rb_define_private_method(class_loader, "path2class", path2class, 1);
}
-/* vim: set noet sws=4 sw=4: */