-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bytes concat #14685
Support bytes concat #14685
Conversation
4a80492
to
effab73
Compare
be52960
to
9e713cb
Compare
f5270cd
to
4528fcc
Compare
@@ -28,7 +28,7 @@ contract C | |||
} | |||
function g(uint x) public { | |||
require(x < severalMaps.length); | |||
f(severalMaps[x]); | |||
f(severalMaps[x]); //should hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be reported. I don't know how to fix it.
6cd0cc1
to
ba2959e
Compare
// ---- | ||
// Warning 6328: (242-256): CHC: Assertion violation happens here.\nCounterexample:\na = [[], [], [0, 0, 0, 0]]\ny = 0\n\nTransaction trace:\nC.constructor()\nState: a = [[], [], [0, 0, 0, 0]]\nC.f() | ||
// Warning 6328: (242-256): CHC: Assertion violation happens here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why no counterexample here
Explanation on 1 argument
Maybe it could be done differently, but I would have to cast values of types fixed bytes, string literals to values of type |
Hey @pgebal the two tests failing seems to be due to out of memory in the CI jobs: https://app.circleci.com/pipelines/github/ethereum/solidity/31908/workflows/a54b0a16-fb08-4f77-989d-13a1bebba3b2/jobs/1425767/resources. If there is no memory leak in the current implementation, and the memory increase is expected, you may need to increase the |
@r0qs Thanks, I noticed that too. I am not sure about the memory increase caused by my changes. I asked @leonardoalt to have a look on this code. Maybe he can find something suspicious here. If Leo thinks it seems right I'll increase |
691a920
to
e21eab9
Compare
f535a42
to
0992050
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good!
Left just a few small comments, but I think this should be soon good to go!
Also, it looks like this PR needs rebase.
libsolidity/formal/Predicate.cpp
Outdated
@@ -381,7 +384,7 @@ std::vector<std::optional<std::string>> Predicate::summaryPostInputValues(std::v | |||
|
|||
auto const& inParams = function->parameters(); | |||
|
|||
auto first = _args.begin() + 6 + static_cast<int>(stateVars->size()) * 2 + static_cast<int>(inParams.size()) + 1; | |||
auto first = _args.begin() + (long)firstArgIndex() + static_cast<int>(stateVars->size()) * 2 + static_cast<int>(inParams.size()) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to cast to long
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because return type of firstArgIndex() is size_t (which seemed to me it makes most sense)
and operator +
for iterator takes long as an argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the other offsets use static_cast<int>
maybe we should at least be consistent with that?
In general, we should prefer static_cast
from C++ to C-style casts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! It's being used in the same line and I didn't notice it!
da5b178
to
4585079
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@pgebal You have to update test expectations for the test where you changed the indentation. |
4585079
to
a8d6a44
Compare
Closes #11997