File tree Expand file tree Collapse file tree 3 files changed +28
-9
lines changed Expand file tree Collapse file tree 3 files changed +28
-9
lines changed Original file line number Diff line number Diff line change
1
+ Tue Mar 29 21:07:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
2
+
3
+ * thread_pthread.c (reserve_stack): fix reserving position where
4
+ the stack growing bottom to top. [Bug #12118]
5
+
1
6
Fri Mar 25 18:42:46 2016 Koichi ITO <koic.ito@gmail.com>
2
7
3
8
* variable.c: Added documentation about order of `Module#constants`
Original file line number Diff line number Diff line change @@ -675,17 +675,31 @@ reserve_stack(volatile char *limit, size_t size)
675
675
const volatile char * end = buf + sizeof (buf );
676
676
limit += size ;
677
677
if (limit > end ) {
678
- size = limit - end ;
679
- limit = alloca (size );
680
- limit [stack_check_margin + size - 1 ] = 0 ;
678
+ /* |<-bottom (=limit(a)) top->|
679
+ * | .. |<-buf 256B |<-end | stack check |
680
+ * | 256B | =size= | margin (4KB)|
681
+ * | =size= limit(b)->| 256B | |
682
+ * | | alloca(sz) | | |
683
+ * | .. |<-buf |<-limit(c) [sz-1]->0> | |
684
+ */
685
+ size_t sz = limit - end ;
686
+ limit = alloca (sz );
687
+ limit [sz - 1 ] = 0 ;
681
688
}
682
689
}
683
690
else {
684
691
limit -= size ;
685
692
if (buf > limit ) {
686
- limit = alloca (buf - limit );
687
- limit [0 ] = 0 ; /* ensure alloca is called */
688
- limit -= stack_check_margin ;
693
+ /* |<-top (=limit(a)) bottom->|
694
+ * | .. | 256B buf->| | stack check |
695
+ * | 256B | =size= | margin (4KB)|
696
+ * | =size= limit(b)->| 256B | |
697
+ * | | alloca(sz) | | |
698
+ * | .. | buf->| limit(c)-><0> | |
699
+ */
700
+ size_t sz = buf - limit ;
701
+ limit = alloca (sz );
702
+ limit [0 ] = 0 ;
689
703
}
690
704
}
691
705
}
Original file line number Diff line number Diff line change 1
1
#define RUBY_VERSION "2.1.9"
2
- #define RUBY_RELEASE_DATE "2016-03-26 "
3
- #define RUBY_PATCHLEVEL 486
2
+ #define RUBY_RELEASE_DATE "2016-03-29 "
3
+ #define RUBY_PATCHLEVEL 487
4
4
5
5
#define RUBY_RELEASE_YEAR 2016
6
6
#define RUBY_RELEASE_MONTH 3
7
- #define RUBY_RELEASE_DAY 26
7
+ #define RUBY_RELEASE_DAY 29
8
8
9
9
#include "ruby/version.h"
10
10
You can’t perform that action at this time.
0 commit comments