File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
trunk/src/libcore/unstable Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 5f52669296bceac4907608a6ac3bfba41de7dab9
2
+ refs/heads/master: 0dc6c414af158370b73bfd379bec84a1a8d480f6
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5
5
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
Original file line number Diff line number Diff line change @@ -99,8 +99,12 @@ pub unsafe fn borrow_as_imm(a: *u8) {
99
99
#[ lang="return_to_mut" ]
100
100
#[ inline( always) ]
101
101
pub unsafe fn return_to_mut ( a : * u8 ) {
102
- let a: * mut BoxRepr = transmute ( a) ;
103
- ( * a) . header . ref_count &= !FROZEN_BIT ;
102
+ // Sometimes the box is null, if it is conditionally frozen.
103
+ // See e.g. #4904.
104
+ if !a. is_null ( ) {
105
+ let a: * mut BoxRepr = transmute ( a) ;
106
+ ( * a) . header . ref_count &= !FROZEN_BIT ;
107
+ }
104
108
}
105
109
106
110
#[ lang="check_not_borrowed" ]
You can’t perform that action at this time.
0 commit comments