mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Fix panic when a layout constraint has an Expression::Invalid as binding
We can detect this case earlier Fix #6590
This commit is contained in:
parent
6c81d5069e
commit
6717e627a1
2 changed files with 12 additions and 1 deletions
|
@ -406,7 +406,9 @@ fn find_binding<R>(
|
|||
let mut depth = 0;
|
||||
loop {
|
||||
if let Some(b) = element.borrow().bindings.get(name) {
|
||||
return Some(f(&b.borrow(), &element.borrow().enclosing_component, depth));
|
||||
if b.borrow().has_binding() {
|
||||
return Some(f(&b.borrow(), &element.borrow().enclosing_component, depth));
|
||||
}
|
||||
}
|
||||
let e = match &element.borrow().base_type {
|
||||
ElementType::Component(base) => base.root_element.clone(),
|
||||
|
|
9
internal/compiler/tests/syntax/fuzzing/6590.slint
Normal file
9
internal/compiler/tests/syntax/fuzzing/6590.slint
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
component A inherits Window {
|
||||
// ^warning{Component is implicitly marked for export. This is deprecated and it should be explicitly exported}
|
||||
preferred-height: x;
|
||||
// ^error{Unknown unqualified identifier 'x'. Did you mean 'self.x'?}
|
||||
Image { }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue