Skip to content

Commit 4759ad4

Browse files
committed
---
yaml --- r: 94559 b: refs/heads/try c: 28943e9 h: refs/heads/master i: 94557: 88b32ad 94555: 41c67a1 94551: 5bdd9f7 94543: 748a967 94527: 359573f v: v3
1 parent 630b7e7 commit 4759ad4

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 0e2041c54b3065cc285ae19744e8acbff7533890
5+
refs/heads/try: 28943e96cb0f0dfb05b3b5ce604c5a0fb8e24095
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/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)