-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error if Positional Params num is zero
Positional parameter zero ($0) is invalid. Previously, using $0 causes std::out_of_range error due to the underflow and confuses users. ``` % sudo ./src/bpftrace -e 'k:$0 {}' vfs_open terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 1) zsh: abort sudo ./src/bpftrace -e 'k:$0 {}' vfs_open ``` This commit changes this and in the parser check the positional params num is not zero. This can be also done in the lexical analyzer, but to print verbose an error message do this in the parser. Now the error message is ``` % sudo ./src/bpftrace -e 'k:$0 {}' vfs_open stdin:1:1-5: ERROR: param $0 is out of integer range [1, 9223372036854775807] k:$0 {} ~~~ ```
- Loading branch information
Showing
4 changed files
with
6 additions
and
4 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
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