-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scanner: Generate error on inbalanced RLO/LRO/PDF override markers.
- Loading branch information
1 parent
e3b009d
commit 89d09cd
Showing
28 changed files
with
306 additions
and
6 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
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
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_1.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 1 | ||
/*underflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (73-85): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_2.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 2 | ||
/*underflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (73-85): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_3.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 1 | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (74-89): Mismatching directional override markers in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_4.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 2 | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (74-92): Mismatching directional override markers in comment or string literal. |
14 changes: 14 additions & 0 deletions
14
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_5.sol
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,14 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// first push 1, then pop 1 | ||
/*ok */ | ||
|
||
// first push 2, then pop 2 | ||
/*ok */ | ||
|
||
// first push 3, then pop 3 | ||
/*ok */ | ||
} | ||
} | ||
// ---- |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/multiline_unicode_direction_override_6.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// first pop, then push | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (88-99): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_1.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 1 | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (73-86): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_2.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 2 | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (73-86): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_3.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 1 | ||
// overflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (74-89): Mismatching directional override markers in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_4.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 2 | ||
// overflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (74-92): Mismatching directional override markers in comment or string literal. |
14 changes: 14 additions & 0 deletions
14
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_5.sol
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,14 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// first push 1, then pop 1 | ||
// ok | ||
|
||
// first push 2, then pop 2 | ||
// ok | ||
|
||
// first push 3, then pop 3 | ||
// ok | ||
} | ||
} | ||
// ---- |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/comments/singleline_unicode_direction_override_6.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// first pop, then push | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (88-101): Unicode direction override underflow in comment or string literal. |
8 changes: 8 additions & 0 deletions
8
test/libsolidity/syntaxTests/comments/unicode_direction_in_source_1.sol
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,8 @@ | ||
contract C { | ||
function f(bool b) public pure | ||
{ | ||
if (b) { return; } | ||
} | ||
} | ||
// ---- | ||
// ParserError 2314: (65-66): Expected '(' but got 'ILLEGAL' |
8 changes: 8 additions & 0 deletions
8
test/libsolidity/syntaxTests/comments/unicode_direction_in_source_2.sol
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,8 @@ | ||
contract C { | ||
function f(bool b) public pure | ||
{ | ||
uint a = 10; | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (75-76): Invalid token. |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/comments/unicode_direction_override_1.sol
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 @@ | ||
contract TimelockUpgrade { | ||
function confirmUpgrade() external { | ||
uint256 m; | ||
uint256 d; | ||
(/*year*/,/*month*/,d/*yad*/,m/*hour*/,/*minute*/,/*second*/) = BokkyDateTime.timestampToDateTime(block.timestamp); | ||
} | ||
} | ||
|
||
// ---- | ||
// ParserError 8936: (128-139): Mismatching directional override markers in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/literals/unicode_string_direction_override_1.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 1 | ||
bytes memory s = unicode"underflow "; | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (90-108): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/literals/unicode_string_direction_override_2.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 2 | ||
bytes memory m = unicode"underflow "; | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (90-108): Unicode direction override underflow in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/literals/unicode_string_direction_override_3.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 1 | ||
bytes memory m = unicode"overflow "; | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (91-111): Mismatching directional override markers in comment or string literal. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/literals/unicode_string_direction_override_4.sol
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,9 @@ | ||
contract C { | ||
function f() public pure | ||
{ | ||
// push 2 | ||
bytes memory m = unicode"overflow "; | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (91-114): Mismatching directional override markers in comment or string literal. |
Oops, something went wrong.