Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qapi: Reject blank 'if' conditions in addition to empty ones
"'if': 'COND'" generates "#if COND". We reject empty COND because it won't compile. Blank COND won't compile any better, so reject that, too. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190914153506.2151-12-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
- Loading branch information
Markus Armbruster
committed
Sep 24, 2019
1 parent
887a206
commit c2c7065
Showing
3 changed files
with
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
tests/qapi-schema/bad-if-list.json:2: 'if' condition '' makes no sense | ||
tests/qapi-schema/bad-if-list.json:2: 'if' condition ' ' makes no sense |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# check invalid 'if' content | ||
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' }, | ||
'if': ['foo', ''] } | ||
'if': ['foo', ' '] } |