From 6f2bb620827fede4ecba30784f9687d8f6f1f3e2 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 20 Dec 2023 19:11:23 -0700 Subject: [PATCH] Downgrade vis_flags/active_flags error to warn Fixes #18 --- src/util/comment.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/util/comment.rs b/src/util/comment.rs index d2d6b68..e84e94c 100644 --- a/src/util/comment.rs +++ b/src/util/comment.rs @@ -5,6 +5,7 @@ use std::{ use anyhow::{bail, Result}; use num_enum::{IntoPrimitive, TryFromPrimitive}; +use tracing::warn; use crate::{ obj::{ObjSymbol, ObjSymbolKind}, @@ -210,17 +211,11 @@ impl FromReader for CommentSym { out.align = u32::from_reader(reader, e)?; out.vis_flags = u8::from_reader(reader, e)?; if !matches!(out.vis_flags, 0 | 0xD | 0xE) { - return Err(io::Error::new( - io::ErrorKind::InvalidData, - format!("Unknown vis_flags: {:#X}", out.vis_flags), - )); + warn!("Unknown vis_flags: {:#X}", out.vis_flags); } out.active_flags = u8::from_reader(reader, e)?; if !matches!(out.active_flags, 0 | 0x8 | 0x10 | 0x20) { - return Err(io::Error::new( - io::ErrorKind::InvalidData, - format!("Unknown active_flags: {:#X}", out.active_flags), - )); + warn!("Unknown active_flags: {:#X}", out.active_flags); } let value = u8::from_reader(reader, e)?; if value != 0 {