Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make asm diagnostic instruction optional
`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so the instruction shouldn't be blindly unwrapped.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(asm)] | ||
|
||
// only-x86_64 | ||
|
||
fn main() { | ||
unsafe { | ||
asm!("int $3"); //~ ERROR too few operands for instruction | ||
//~| ERROR invalid operand in inline asm | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error: invalid operand in inline asm: 'int $3' | ||
--> $DIR/issue-23458.rs:7:9 | ||
| | ||
LL | asm!("int $3"); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: <inline asm>:1:2: error: too few operands for instruction | ||
int | ||
^ | ||
|
||
--> $DIR/issue-23458.rs:7:9 | ||
| | ||
LL | asm!("int $3"); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|