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

parser bug? #124

Closed
regehr opened this issue Nov 28, 2014 · 3 comments
Closed

parser bug? #124

regehr opened this issue Nov 28, 2014 · 3 comments

Comments

@regehr
Copy link
Collaborator

regehr commented Nov 28, 2014

Take this query:

%0:i8 = var
%1:i1 = eq %0, 1
%2:i1 = eq %0, 2
%3:i1 = eq %0, 4
%4:i1 = eq %0, 8
%5:i1 = eq %0, 16
%6:i1 = eq %0, 32
%7:i1 = eq %0, 64
%8:i1 = eq %0, 128
%9:i1 = or %1, %2, %3, %4, %5, %6, %7, %8
infer %9

%20:i8 = ctpop %0
%21:i1 = eq %20, 1
result %21

Parse and print it, and the result is:

%0:i8 = var
%1:i1 = eq 1:i8, %0
%2:i1 = eq 2:i8, %0
%3:i1 = eq 4:i8, %0
%4:i1 = eq 16:i8, %0
%5:i1 = eq 32:i8, %0
%6:i1 = eq 64:i8, %0
%7:i1 = eq 128:i8, %0
%8:i1 = eq 248:i8, %0
%9:i1 = or %1, %2, %3, %4, %5, %6, %7, %8
%10:i8 = ctpop %0
%11:i1 = eq 1:i8, %10
cand %9 %11

@regehr
Copy link
Collaborator Author

regehr commented Nov 28, 2014

Even after we fix this, we need a way to flush out bugs of this type. I'm thinking perhaps a Souper loopback mode where every query is put through a print/parse RT.

@regehr
Copy link
Collaborator Author

regehr commented Nov 28, 2014

Valgrind is silent so it's likely a logic error and not memory unsafety.

I haven't looked into this bug yet and won't do it tonight.

@chenyang78
Copy link
Contributor

I created a pull request #125 to address this issue.

@regehr regehr closed this as completed Dec 20, 2014
kant added a commit to kant/souper that referenced this issue Jan 31, 2018
on google#124. Plus minor fixes (proposal)
@kant kant mentioned this issue Jan 31, 2018
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

No branches or pull requests

2 participants