ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-internals
perl6-internals
Exception handling dumps second time round
by Jos Visser other posts by this author
Aug 19 2003 8:32AM messages near this date
Re: Backend to MosML | Re: Exception handling dumps second time round
When I install and use an exception handler for the second time Parrot
dumps. It looks like the "set_eh" messes up the sub object in P10
because when I uncomment the second newsub it works...

Is this a behaviour of the hidden invoke (of the exception handler) that
I am unaware of?

++Jos.nl

------------------------------------------------------------------------
.sub _main
		
	new_pad 0

	newsub P10, .Exception_Handler, _handler

	I12=1
	set_eh P10
	find_lex P13,"a"
	clear_eh
	P13=new PerlNum
	store_lex -1,"a",P13
	P13=I12
	find_lex P14,"a"
	print P14

	I17=2
	#newsub P10, .Exception_Handler, _handler
	set_eh P10
	print "mark1\n"
	find_lex P13,"b"	# <=== Crashes here
	print "mark2\n"
	clear_eh
	P18=new PerlNum
	store_lex -1,"b",P18
	P18=I17
	print P18
	end
.end

.sub _handler
        print "Hi from handler\n"
        set P2, P5["_invoke_cc"]
        invoke P2
.end
------------------------------------------------------------------------

When I run this code, "mark1" gets printed but then the interpreter
crashes:

------------------------------------------------------------------------
josv@jadzia:~/parrot/test >  ../parrot test9.pir 

Hi from handler
1mark1
Segmentation fault (core dumped)
------------------------------------------------------------------------

++Jos.nl

-- 
ek is so lug jy vlieg deur my
sonder jou is ek sonder patroon
   "Breyten Breytenbach"


Thread:
Jos Visser
Nicholas Clark
Leopold Toetsch

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved