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

cxx_assign_const produces wrong diffs #1023

Closed
Reen opened this issue May 9, 2023 · 3 comments · Fixed by #1026
Closed

cxx_assign_const produces wrong diffs #1023

Reen opened this issue May 9, 2023 · 3 comments · Fixed by #1026

Comments

@Reen
Copy link

Reen commented May 9, 2023

Hi,

thanks for this great tool.
I'm trying to use it on my code and I get patches like this from the cxx_assign_const mutator:

survivedfoo_hpp-cxx_assign_const-L81-C34.patch

--- a/foo.hpp 0
+++ b/foo.hpp 0
@@ -81,1 +81,1 @@
-        _inv_rotation_matrix[0U] = matrix[3U] / det;
+        _inv_rotation_matrix[0U] 42 matrix[3U] / det;
--
Build Date: 09 May 2023
Commit: 5965c74b
LLVM Version: 14.0.0
Mull Version: 0.20.0
URL: https://github.com/mull-project/mull

I assume, that it mutated the matrix[3U] into 42?

Environment

Ubuntu 22.04
Clang 14
Built from source
Commit: 5965c74

@AlexDenisov
Copy link
Member

Hi @Reen, apologies for the late reply.

We are using debug information for such patches/replacements, I think in this case the debug info is pointing to = so I think the mutant was of this form:

_inv_rotation_matrix[0U] = 42;

@AlexDenisov
Copy link
Member

Hi @Reen, I've fixed the issue here, the right patch for your case should produce _inv_rotation_matrix[0U] = 42; matrix[3U] / det; as we do not eliminate the right-hand side of the assignment.
I'll cut the new release shortly, please to not hesitate to reopen the issue if the problems persists or you find another edge case not properly handled.

@AlexDenisov
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants