Skip to content

Commit

Permalink
Fix ICE with trans of calls to foreign fns
Browse files Browse the repository at this point in the history
It was failing occasionally.
  • Loading branch information
pczarn committed Sep 6, 2014
1 parent 10935de commit 808e039
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc/middle/trans/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ fn trans<'a>(bcx: &'a Block<'a>, expr: &ast::Expr) -> Callee<'a> {
let expr_ty = node_id_type(bcx, ref_expr.id);
match def {
def::DefFn(did, _) if {
let def_id = inline::maybe_instantiate_inline(bcx.ccx(), did);
match bcx.tcx().map.find(def_id.node) {
let maybe_def_id = inline::get_local_instance(bcx.ccx(), did);
let maybe_ast_node = maybe_def_id.and_then(|def_id| bcx.tcx().map
.find(def_id.node));
match maybe_ast_node {
Some(ast_map::NodeStructCtor(_)) => true,
_ => false
}
Expand Down

5 comments on commit 808e039

@bors
Copy link
Contributor

@bors bors commented on 808e039 Sep 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at pczarn@808e039

@bors
Copy link
Contributor

@bors bors commented on 808e039 Sep 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pczarn/rust/issue-15913-ICE-with-call-trans = 808e039 into auto

@bors
Copy link
Contributor

@bors bors commented on 808e039 Sep 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pczarn/rust/issue-15913-ICE-with-call-trans = 808e039 merged ok, testing candidate = a39f69f

@bors
Copy link
Contributor

@bors bors commented on 808e039 Sep 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a39f69f

Please sign in to comment.