Updated solc-version detector test contract and fixed an issue where a [x,x) or (x,x] bound would allow x.

pull/129/head
David Pokora 6 years ago
parent c57f2cecc1
commit 945cbc64d7
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 2
      slither/detectors/attributes/old_solc.py
  2. 4
      tests/old_solc.sol

@ -147,7 +147,7 @@ class OldSolc(AbstractDetector):
:return: Returns True if the range can encapsulate any possible value, False if it is an invalid range.
"""
return self.lower < self.upper or \
(self.lower == self.upper and (self.lower_inclusive or self.upper_inclusive))
(self.lower == self.upper and (self.lower_inclusive and self.upper_inclusive))
@property

@ -1,4 +1,6 @@
pragma solidity 0.4.21;
// The version pragma below should get flagged by the detector
// Reason: The expression "^0.4.0 >0.4.2" allows old solc (<0.4.23)
pragma solidity ^0.5.22 || 0.4.23 - 0.4.24 || ^0.4.0 >0.4.2 || ~0.0.0 ^0.5.0 <= 0.5.50 || > 0.7.0;
contract Contract{

Loading…
Cancel
Save