Skip to content
Permalink
Browse files

Merge pull request #855 from kachick/segfault-kernel-catch

Guard Kernel.#catch without block from segfault
  • Loading branch information
alex committed Oct 24, 2015
2 parents c9ad0aa + cdfcb70 commit 4ec45fe4954202776b92039a4bf54230376ffbde
Showing with 2 additions and 1 deletion.
  1. +0 −1 spec/tags/core/kernel/catch_tags.txt
  2. +2 −0 topaz/modules/kernel.py
@@ -3,7 +3,6 @@ fails:Kernel.catch raises an ArgumentError if a Symbol is thrown for a String ca
fails:Kernel.catch raises an ArgumentError if a String with different identity is thrown
fails:Kernel.catch accepts an object as an argument
fails:Kernel.catch yields an object when called without arguments
fails:Kernel.catch raises LocalJumpError if no block is given
fails:Kernel.catch when nested catches across invocation boundaries
fails:Kernel.catch when nested catches in the nested invocation with the same key object
fails:Kernel#catch is a private method
@@ -435,6 +435,8 @@ def method_throw(self, space, name, w_value=None):

@moduledef.method("catch", name="symbol")
def method_catch(self, space, name, block):
if block is None:
raise space.error(space.w_LocalJumpError, "no block given")
from topaz.interpreter import Throw
with space.getexecutioncontext().catch_block(name):
try:

0 comments on commit 4ec45fe

Please sign in to comment.