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_minus_to_noop produces wrong diff(patch file) #1025

Closed
topcue opened this issue May 31, 2023 · 4 comments · Fixed by #1026
Closed

cxx_minus_to_noop produces wrong diff(patch file) #1025

topcue opened this issue May 31, 2023 · 4 comments · Fixed by #1026

Comments

@topcue
Copy link

topcue commented May 31, 2023

hello.
I am reporting that mull creates an incorrect patch file.

  • environment

Ubuntu 20.04
clang-12
install w/ "sudo apt-get install mull-12"


The cxx_minus_to_noop mutator works as follows.

Simple example code for bug reproducing.

  • a.c.
#include <stdio.h>

int main() {
     int x = -1;
     int y = -x;

     return y;
}
  • command
clang-12 -fexperimental-new-pass-manager \
   -fpass-plugin=/usr/lib/mull-ir-frontend-12 \
   -g -grecord-command-line \
   a.c
  • output (killed-home_topcue_tmp_a_c-cxx_minus_to_noop-L5-C13.patch)
--- a/home/topcue/tmp/a.c 0
+++ b/home/topcue/tmp/a.c 0
@@ -5,1 +5,1 @@
- int y = -x;
+ int y = ;
--
Build Date: 17 Jan 2023
Commit: 3060128
LLVM Version: 12.0.0
Mull Version: 0.20.0
URL: https://github.com/mull-project/mull

Instead of int y = ;, int y = x; should be generated, but the patch file is generated as above.

Thanks.

@AlexDenisov
Copy link
Member

Hi @topcue, thank you so much for bringing this up. It's very similar to the other issue (#1023) and I think I have a solution for both of these in mind. I'll do my best to address these issues soon.

@AlexDenisov
Copy link
Member

Hi @topcue, the issue is fixed here. I'll cut the new release soon.

@AlexDenisov
Copy link
Member

Here we go https://github.com/mull-project/mull/releases/tag/0.21.0

@topcue
Copy link
Author

topcue commented Jun 2, 2023

Thanks!

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