Fortify dummy span checking
This commit is contained in:
parent
297109ea32
commit
9f92fce77c
21 changed files with 59 additions and 59 deletions
|
|
@ -1662,7 +1662,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx,
|
|||
let var_scope = get_namespace_for_item(cx, def_id);
|
||||
let span = tcx.def_span(def_id);
|
||||
|
||||
let (file_metadata, line_number) = if span != syntax_pos::DUMMY_SP {
|
||||
let (file_metadata, line_number) = if !span.is_dummy() {
|
||||
let loc = span_start(cx, span);
|
||||
(file_metadata(cx, &loc.file.name, LOCAL_CRATE), loc.line as c_uint)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
|
|||
let span = mir.span;
|
||||
|
||||
// This can be the case for functions inlined from another crate
|
||||
if span == syntax_pos::DUMMY_SP {
|
||||
if span.is_dummy() {
|
||||
// FIXME(simulacrum): Probably can't happen; remove.
|
||||
return FunctionDebugContext::FunctionWithoutDebugInfo;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue