Commits

Kristjan Valur Jonsson  committed 743e4f9

Fix a serious bug on 64 bit windows. slp_save_state was using an int to compute stack differences. When this function was called from assembler, it was not automatically sign extended to 64 bits, and therefore, negative results got interpreted as large positive ones.
Now the testsuite runs perfectly on XP64

  • Participants
  • Parent commits 7d83dda
  • Branches release25-maint

Comments (0)

Files changed (1)

File Stackless/core/slp_transfer.c

 #undef __return
 #define __return(x) { exitcode = x; goto exit; }
 
-int slp_save_state(intptr_t *stack){
-	int exitcode;
-#ifdef SSIZE_T
-	/* Only on Windows apparently. */
-	SSIZE_T diff;
-#else
-	/* Py_ssize_t when we port to 2.5? */
-	int diff;
-#endif
+intptr_t slp_save_state(intptr_t *stack){
+	intptr_t exitcode;
+	intptr_t diff;
 	SLP_SAVE_STATE(stack, diff);
 	return diff;
 exit: