Skip to content

Commit 7739a64

Browse files
committed
---
yaml --- r: 88895 b: refs/heads/snap-stage3 c: 28943e9 h: refs/heads/master i: 88893: dd3867b 88891: 286274e 88887: 775fb86 88879: d309cc8 88863: addc835 88831: b60752b v: v3
1 parent fb50ef6 commit 7739a64

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0e2041c54b3065cc285ae19744e8acbff7533890
4+
refs/heads/snap-stage3: 28943e96cb0f0dfb05b3b5ce604c5a0fb8e24095
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/consts.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ pub fn const_lit(cx: &mut CrateContext, e: &ast::Expr, lit: ast::lit)
7979
pub fn const_ptrcast(cx: &mut CrateContext, a: ValueRef, t: Type) -> ValueRef {
8080
unsafe {
8181
let b = llvm::LLVMConstPointerCast(a, t.ptr_to().to_ref());
82-
assert!(cx.const_globals.insert(b as int, a));
82+
let mut const_globals = cx.const_globals.borrow_mut();
83+
assert!(const_globals.get().insert(b as int, a));
8384
b
8485
}
8586
}
@@ -111,7 +112,8 @@ fn const_addr_of(cx: &mut CrateContext, cv: ValueRef) -> ValueRef {
111112
}
112113

113114
fn const_deref_ptr(cx: &mut CrateContext, v: ValueRef) -> ValueRef {
114-
let v = match cx.const_globals.find(&(v as int)) {
115+
let const_globals = cx.const_globals.borrow();
116+
let v = match const_globals.get().find(&(v as int)) {
115117
Some(&v) => v,
116118
None => v
117119
};

branches/snap-stage3/src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct CrateContext {
8181
// when we ptrcast, and we have to ptrcast during translation
8282
// of a [T] const because we form a slice, a [*T,int] pair, not
8383
// a pointer to an LLVM array type.
84-
const_globals: HashMap<int, ValueRef>,
84+
const_globals: RefCell<HashMap<int, ValueRef>>,
8585

8686
// Cache of emitted const values
8787
const_values: HashMap<ast::NodeId, ValueRef>,
@@ -198,7 +198,7 @@ impl CrateContext {
198198
monomorphizing: RefCell::new(HashMap::new()),
199199
vtables: RefCell::new(HashMap::new()),
200200
const_cstr_cache: RefCell::new(HashMap::new()),
201-
const_globals: HashMap::new(),
201+
const_globals: RefCell::new(HashMap::new()),
202202
const_values: HashMap::new(),
203203
extern_const_values: HashMap::new(),
204204
impl_method_cache: HashMap::new(),

0 commit comments

Comments
 (0)