mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 05:43:53 +01:00
fix bug where #include included files would be able to access local variables and custom types. now, only globals are shared.
This commit is contained in:
parent
4144d6cf71
commit
12af47d18a
@ -52,7 +52,7 @@ impl<L: Local> Local for Info<L> {
|
||||
}
|
||||
fn duplicate(&self) -> Self {
|
||||
Self {
|
||||
scopes: self.scopes.iter().map(|v| v.duplicate()).collect(),
|
||||
scopes: vec![self.scopes[0].duplicate()],
|
||||
global: self.global.clone(),
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ impl MersStatement for IncludeMers {
|
||||
comp: CompInfo,
|
||||
) -> Result<Box<dyn program::run::MersStatement>, CheckError> {
|
||||
let compiled: Arc<Box<dyn crate::program::run::MersStatement>> =
|
||||
match self.include.compile(info, comp) {
|
||||
match self.include.compile(&mut info.duplicate(), comp) {
|
||||
Ok(v) => Arc::new(v),
|
||||
Err(e) => {
|
||||
return Err(CheckError::new()
|
||||
|
Loading…
Reference in New Issue
Block a user