Skip to content

Commit e986ac7

Browse files
committed
AML: don't error on name collisions
1 parent 91e0c0f commit e986ac7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/aml/namespace.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use alloc::{
99
};
1010
use bit_field::BitField;
1111
use core::{fmt, str, str::FromStr};
12+
use log::trace;
1213

1314
#[derive(Clone)]
1415
pub struct Namespace {
@@ -70,7 +71,14 @@ impl Namespace {
7071
let (level, last_seg) = self.get_level_for_path_mut(&path)?;
7172
match level.values.insert(last_seg, (ObjectFlags::new(false), object)) {
7273
None => Ok(()),
73-
Some(_) => Err(AmlError::NameCollision(path)),
74+
Some(_) => {
75+
/*
76+
* Real AML often has name collisions, and so we can't afford to be too strict
77+
* about it. We do warn the user as it does have the potential to break stuff.
78+
*/
79+
trace!("AML name collision: {}. Replacing object.", path);
80+
Ok(())
81+
}
7482
}
7583
}
7684

0 commit comments

Comments
 (0)