-
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
b62de4f
commit b666df5
Showing
17 changed files
with
276 additions
and
11 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
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 1 | ||
/*underflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (137-152): Unicode direction override underflow in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 2 | ||
/*underflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (137-152): Unicode direction override underflow in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// push 1 | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (138-153): Mismatching directional override markers in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// push 2 | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (138-156): Mismatching directional override markers in comment. |
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
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 */ | ||
} | ||
} | ||
// ---- |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// first pop, then push | ||
/*overflow */ | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (152-166): Unicode direction override underflow in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 1 | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (137-153): Unicode direction override underflow in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// pop 2 | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (137-153): Unicode direction override underflow in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// push 1 | ||
// overflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (138-153): Mismatching directional override markers in comment. |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// push 2 | ||
// overflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (138-156): Mismatching directional override markers in comment. |
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
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 | ||
} | ||
} | ||
// ---- |
12 changes: 12 additions & 0 deletions
12
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,12 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.0; | ||
|
||
contract C { | ||
function f() public pure | ||
{ | ||
// first pop, then push | ||
// underflow | ||
} | ||
} | ||
// ---- | ||
// ParserError 8936: (152-168): Unicode direction override underflow in comment. |