summaryrefslogtreecommitdiff
path: root/rust/examples
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-11-18 15:50:02 -0500
committerJosh Ferrell <josh@vector35.com>2024-11-18 15:50:02 -0500
commitcf123e5bed902a51223bbd0fd8baefa50a5993b0 (patch)
treec8713cc3f5e089170cf4bbd09e6664e872d1f048 /rust/examples
parent43870ac3825272c917420b9063d068d9683675dd (diff)
Fix crash when using DWARF export with array of 0-sized types
Diffstat (limited to 'rust/examples')
-rw-r--r--rust/examples/dwarf/dwarf_export/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/examples/dwarf/dwarf_export/src/lib.rs b/rust/examples/dwarf/dwarf_export/src/lib.rs
index 18cc1e21..9ebf3bc7 100644
--- a/rust/examples/dwarf/dwarf_export/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_export/src/lib.rs
@@ -287,7 +287,7 @@ fn export_type(
dwarf.unit.get_mut(array_dimension_die_uid).set(
gimli::DW_AT_upper_bound,
- AttributeValue::Data8((current_t.width() / element_type.width()) - 1),
+ AttributeValue::Data8(current_t.count() - 1),
);
if element_type.type_class() != TypeClass::ArrayTypeClass {