mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Keep constraints of string literals after assignment
This commit is contained in:
parent
5090353a1a
commit
9c1b041dcb
@ -5,7 +5,7 @@ Language Features:
|
||||
|
||||
Compiler Features:
|
||||
* Export compiler-generated utility sources via standard-json or combined-json.
|
||||
* SMTChecker: Keep knowledge about string literals and thus support the ``.length`` property properly.
|
||||
* SMTChecker: Keep knowledge about string literals, even through assignment, and thus support the ``.length`` property properly.
|
||||
* SMTChecker: Support events and low-level logs.
|
||||
* SMTChecker: Support ``revert()``.
|
||||
* SMTChecker: Support shifts.
|
||||
|
@ -1690,9 +1690,7 @@ void SMTEncoder::assignment(VariableDeclaration const& _variable, Expression con
|
||||
// This is a special case where the SMT sorts are different.
|
||||
// For now we are unaware of other cases where this happens, but if they do appear
|
||||
// we should extract this into an `implicitConversion` function.
|
||||
if (_variable.type()->category() != Type::Category::Array || _value.annotation().type->category() != Type::Category::StringLiteral)
|
||||
assignment(_variable, expr(_value, _variable.type()));
|
||||
// TODO else { store each string literal byte into the array }
|
||||
assignment(_variable, expr(_value, _variable.type()));
|
||||
}
|
||||
|
||||
void SMTEncoder::assignment(VariableDeclaration const& _variable, smtutil::Expression const& _value)
|
||||
|
@ -10,4 +10,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (161-181): Assertion violation happens here.
|
||||
// Warning 6328: (215-235): Assertion violation happens here.
|
||||
|
@ -11,5 +11,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (164-184): Assertion violation happens here.
|
||||
// Warning 6328: (194-214): Assertion violation happens here.
|
||||
// Warning 6328: (248-268): Assertion violation happens here.
|
||||
|
@ -11,4 +11,3 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (106-127): Assertion violation happens here.
|
||||
|
@ -16,6 +16,3 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (111-140): Assertion violation happens here.
|
||||
// Warning 6328: (217-246): Assertion violation happens here.
|
||||
// Warning 6328: (353-382): Assertion violation happens here.
|
||||
|
Loading…
Reference in New Issue
Block a user