Skip to content

Commit 7ea48f5

Browse files
committed
Fix the section syntax, it should not start with a period.
1 parent 903eb4d commit 7ea48f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

redox-core/src/parsing/asm_parser.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'a> AsmParser<'a> {
148148
continue;
149149
}
150150

151-
if line.starts_with(".section") {
151+
if line.starts_with("section") {
152152
section = AsmParser::parse_section_line(line);
153153
continue;
154154
}
@@ -380,12 +380,12 @@ impl<'a> AsmParser<'a> {
380380
/// A [`FileSection`] instance if a valid one was specified. This method will panic otherwise.
381381
#[inline]
382382
fn parse_section_line(line: &str) -> FileSection {
383-
assert!(line.len() >= 10);
383+
assert!(line.len() >= 9);
384384

385-
if let Ok(section) = FileSection::from_str(&line[10..]) {
385+
if let Ok(section) = FileSection::from_str(&line[9..]) {
386386
section
387387
} else {
388-
panic!("invalid assembly file section name - {}", &line[10..])
388+
panic!("invalid assembly file section name - {}", &line[9..])
389389
}
390390
}
391391

@@ -1307,14 +1307,14 @@ mod tests_asm_parsing {
13071307
),
13081308
// This is invalid because there must be something after the section marker.
13091309
ParserTest::new(
1310-
".section",
1310+
"section",
13111311
&[],
13121312
true,
13131313
"succeeded in parsing invalid section marker.",
13141314
),
13151315
// This is invalid because the section marker isn't valid.
13161316
ParserTest::new(
1317-
".section abc",
1317+
"section abc",
13181318
&[],
13191319
true,
13201320
"succeeded in parsing invalid section marker.",

0 commit comments

Comments
 (0)