You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use nom_locate::LocatedSpan;fnmain(){let fragment = [b'a',b'b',b'c',b'd'];let span = LocatedSpan{offset:12345,line:0,fragment: std::str::from_utf8(&fragment).unwrap(),extra:()};println!("{}", span.get_utf8_column());}
Can this happen without constructing a LocatedSpan manually? I don't see any reason to do that; we should probably add an empty private field so it doesn't happen.
The following code:
prints random garbage value.
The problem is here:
nom_locate/src/lib.rs
Lines 216 to 223 in 504e849
There is no guarantee that
self.offset
bytes beforeself.fragment.as_bytes().as_ptr()
are actually readable.The text was updated successfully, but these errors were encountered: