# Patch created by krokas
# Date: Tue Mar 14 01:49:35 MSK 2006
# Repository: libjit
# Comments:
# 
#### End of Preamble ####

#### Patch data follows ####
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/./libjit/ChangeLog,v
retrieving revision 1.208
diff -u -b -B -c -r1.208 ChangeLog
*** ChangeLog	12 Mar 2006 20:04:39 -0000	1.208
--- ChangeLog	13 Mar 2006 22:49:34 -0000
***************
*** 9,14 ****
--- 9,19 ----
  	if the called function is not the callee function
  	(thanks klausT for finding the bug).
  
+ 2006-03-02  Kirill Kononenko  <Kirill.Konononenko@gmail.com>
+ 	* jit/jit-insn.c: Implement jit_insn_thrown_exception.
+ 	jit_insn_thrown_exception returns the last exception thrown with
+ 	jit_insn_throw.
+ 
  2006-02-27  Aleksey Demakov  <ademakov@gmail.com>
  
  	* jit/jit-insn.c (jit_insn_convert): fix int->uint and uint->int
Index: jit/jit-insn.c
===================================================================
RCS file: /sources/dotgnu-pnet/./libjit/jit/jit-insn.c,v
retrieving revision 1.43
diff -u -b -B -c -r1.43 jit-insn.c
*** jit/jit-insn.c	12 Mar 2006 20:04:39 -0000	1.43
--- jit/jit-insn.c	13 Mar 2006 22:49:38 -0000
***************
*** 6902,6909 ****
--- 6902,6915 ----
  	{
  		return 0;
  	}
+ 	if(!(func->builder->thrown_exception))
+ 	{
+ 		func->builder->thrown_exception = 
+ 			jit_value_create(func, jit_type_void_ptr);
+ 	}
  	func->builder->may_throw = 1;
  	func->builder->non_leaf = 1;	/* May have to call out to throw */
+ 	func->builder->thrown_exception = jit_insn_dup(func, value);
  	if(!create_unary_note(func, JIT_OP_THROW, value))
  	{
  		return 0;
***************
*** 6956,6966 ****
  	{
  		return 0;
  	}
- 	if(!(func->builder->thrown_exception))
- 	{
- 		func->builder->thrown_exception =
- 			jit_value_create(func, jit_type_void_ptr);
- 	}
  	return func->builder->thrown_exception;
  }
  
#### End of Patch data ####
