@@ -251,7 +251,7 @@ struct FunctionDebugContextData {
251
251
scope_map : RefCell < HashMap < ast:: NodeId , DIScope > > ,
252
252
fn_metadata : DISubprogram ,
253
253
argument_counter : Cell < uint > ,
254
- source_locations_enabled : bool ,
254
+ source_locations_enabled : Cell < bool > ,
255
255
}
256
256
257
257
enum VariableAccess < ' a > {
@@ -569,7 +569,7 @@ pub fn set_source_location(fcx: &FunctionContext,
569
569
570
570
debug ! ( "set_source_location: {}" , cx. sess. codemap. span_to_str( span) ) ;
571
571
572
- if fcx. debug_context . get_ref ( cx, span) . source_locations_enabled {
572
+ if fcx. debug_context . get_ref ( cx, span) . source_locations_enabled . get ( ) {
573
573
let loc = span_start ( cx, span) ;
574
574
let scope = scope_metadata ( fcx, node_id, span) ;
575
575
@@ -598,7 +598,9 @@ pub fn clear_source_location(fcx: &FunctionContext) {
598
598
/// translated.
599
599
pub fn start_emitting_source_locations ( fcx : & mut FunctionContext ) {
600
600
match fcx. debug_context {
601
- FunctionDebugContext ( ~ref mut data) => data. source_locations_enabled = true ,
601
+ FunctionDebugContext ( ~ref mut data) => {
602
+ data. source_locations_enabled . set ( true )
603
+ } ,
602
604
_ => { /* safe to ignore */ }
603
605
}
604
606
}
@@ -765,7 +767,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
765
767
scope_map : RefCell :: new ( HashMap :: new ( ) ) ,
766
768
fn_metadata : fn_metadata,
767
769
argument_counter : Cell :: new ( 1 ) ,
768
- source_locations_enabled : false ,
770
+ source_locations_enabled : Cell :: new ( false ) ,
769
771
} ;
770
772
771
773
let arg_pats = fn_decl. inputs . map ( |arg_ref| arg_ref. pat ) ;
@@ -1049,7 +1051,11 @@ fn declare_local(bcx: @Block,
1049
1051
1050
1052
match variable_kind {
1051
1053
ArgumentVariable ( _) | CapturedVariable => {
1052
- assert ! ( !bcx. fcx. debug_context. get_ref( cx, span) . source_locations_enabled) ;
1054
+ assert ! ( !bcx. fcx
1055
+ . debug_context
1056
+ . get_ref( cx, span)
1057
+ . source_locations_enabled
1058
+ . get( ) ) ;
1053
1059
set_debug_location ( cx, UnknownLocation ) ;
1054
1060
}
1055
1061
_ => { /* nothing to do */ }
0 commit comments