Skip to content
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

[dmd-cxx] expression.c: Fix wrong sizeof VectorArrayExp #11046

Merged
merged 1 commit into from
Apr 19, 2020

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Apr 19, 2020

This Expression node is smaller than VectorExp, causing valgrind to complain.

==162456== Invalid read of size 8
==162456== at 0x6C38E9: Expression::copy() (expression.c:2046)
==162456== by 0x664547: visit (dcast.c:68)
==162456== by 0x664547: implicitCastTo(Expression*, Scope*, Type*)::ImplicitC
astTo::visit(Expression*) (dcast.c:54)
==162456== by 0x66BE8A: implicitCastTo(Expression*, Scope*, Type*) (dcast.c:1
60)

This Expression node is smaller than VectorExp, causing valgrind to complain.

==162456== Invalid read of size 8
==162456==    at 0x6C38E9: Expression::copy() (expression.c:2046)
==162456==    by 0x664547: visit (dcast.c:68)
==162456==    by 0x664547: implicitCastTo(Expression*, Scope*, Type*)::ImplicitC
astTo::visit(Expression*) (dcast.c:54)
==162456==    by 0x66BE8A: implicitCastTo(Expression*, Scope*, Type*) (dcast.c:1
60)
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "dmd-cxx + dmd#11046"

@ibuclaw ibuclaw merged commit ba99ee3 into dlang:dmd-cxx Apr 19, 2020
@ibuclaw ibuclaw deleted the dmd-cxx-valgrind2 branch April 19, 2020 12:22
kraj pushed a commit to kraj/gcc that referenced this pull request Apr 19, 2020
Initializes the VectorArrayExp::size field with the correct value.

Fixes: PR d/94652

Reviewed-on: dlang/dmd#11046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants