Created
May 21, 2013 10:03
-
-
Save badosu/5618731 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vm/builtin/block_environment.cpp b/vm/builtin/block_environment.cpp | |
index d603156..ba93f94 100644 | |
--- a/vm/builtin/block_environment.cpp | |
+++ b/vm/builtin/block_environment.cpp | |
@@ -149,6 +149,13 @@ namespace rubinius { | |
if(!(ary = try_as<Array>(obj))) { | |
if(CBOOL(obj->respond_to(state, G(sym_to_ary), cFalse))) { | |
obj = obj->send(state, call_frame, G(sym_to_ary)); | |
+ if(!obj) { | |
+ Exception* exc = | |
+ as<Exception>(state->vm()->thread_state()->current_exception()); | |
+ exc->locations(state, Location::from_call_stack(state, call_frame)); | |
+ state->raise_exception(exc); | |
+ return NULL; | |
+ } | |
if(!(ary = try_as<Array>(obj))) { | |
Exception::type_error(state, "to_ary must return an Array", call_frame); | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment