Commits

Armin Rigo committed e76f2b7

Baaaaah. setjmp() cannot be called on a jmp_buf that belongs to a parent
frame, because then longjmp()ing to it will not automatically recreate
the subframe... Need to fix it by introducing macros instead of a function
call.

Comments (0)

Files changed (2)

pypy/translator/stm/src_stm/et.c

   tx_abort(7);     /* manual abort */
 }
 
-void stm_transaction_boundary(jmp_buf* buf)
-{
-#ifdef RPY_STM_ASSERT
-  PYPY_DEBUG_START("stm-transaction-boundary");
-#endif
-  stm_commit_transaction();
-  setjmp(*buf);
-  stm_begin_transaction(buf);
-#ifdef RPY_STM_ASSERT
-  PYPY_DEBUG_STOP("stm-transaction-boundary");
-#endif
-}
-
 // XXX little-endian only!
 void stm_write_partial_word(int fieldsize, char *base, long offset,
                             unsigned long nval)

pypy/translator/stm/src_stm/et.h

 void stm_try_inevitable_if(jmp_buf* buf  STM_CCHARP(why));
 void stm_begin_inevitable_transaction(void);
 void stm_abort_and_retry(void);
-void stm_transaction_boundary(jmp_buf* buf);
 void stm_descriptor_init_and_being_inevitable_transaction(void);
 void stm_commit_transaction_and_descriptor_done(void);
 
 #define STM_DECLARE_VARIABLE()          ; jmp_buf jmpbuf
 #define STM_MAKE_INEVITABLE()           stm_try_inevitable_if(&jmpbuf  \
                                                         STM_EXPLAIN("return"))
-#define STM_TRANSACTION_BOUNDARY()      stm_transaction_boundary(&jmpbuf)
+#define STM_TRANSACTION_BOUNDARY()      \
+       stm_commit_transaction();        \
+       setjmp(jmpbuf);                  \
+       stm_begin_transaction(&jmpbuf);
+
 
 // XXX little-endian only!
 #define STM_read_partial_word(T, base, offset)                          \