From 7937ccee304d18d91ca638d27d2babe5200aba17 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Wed, 17 Mar 2021 18:58:33 -0600 Subject: [PATCH] check that a load context path is a filename before potentially returning it as a string --- src/machine/compile.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/machine/compile.rs b/src/machine/compile.rs index 3e96672e..629d790e 100644 --- a/src/machine/compile.rs +++ b/src/machine/compile.rs @@ -1318,6 +1318,10 @@ fn print_overwrite_warning( impl<'a> LoadState<'a> { pub(super) fn listing_src_file_name(&self) -> Option { if let Some(load_context) = self.wam.load_contexts.last() { + if !load_context.path.is_file() { + return None; + } + if let Some(path_str) = load_context.path.to_str() { if !path_str.is_empty() { return Some(clause_name!(path_str.to_string(), self.wam.machine_st.atom_tbl)); -- 2.54.0