Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Assert that Mach-O section_flags_mut is 0 (#13153)

Mads Marquart83e8a7bc36d8
diff --git a/cranelift/object/src/backend.rs b/cranelift/object/src/backend.rs
index 5d221f7b41..c25369d902 100644
--- a/cranelift/object/src/backend.rs
+++ b/cranelift/object/src/backend.rs
@@ -518,6 +518,13 @@ impl Module for ObjectModule {
match self.object.section_flags_mut(section) {
SectionFlags::MachO { flags } => {
+ // There are no default flags for the `SectionKind`s that
+ // we've specified above, so it's fine to override.
+ //
+ // (If we don't want to override, we'll have to be careful
+ // with how we set these, to ensure we set the section
+ // type properly).
+ assert_eq!(*flags, 0);
*flags = *macho_flags;
}
_ => {