vtil-project / VTIL-Core

Virtual-machine Translation Intermediate Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stack overflow during simpilfication. #2

zzz9328fb opened this issue · comments

expression X_00 = { {"X_00"}, 1 };
expression X_01 = { {"X_01"}, 1 };
expression X_02 = { {"X_02"}, 1 };
expression X_03 = { {"X_03"}, 1 };
expression X_04 = { {"X_04"}, 1 };
expression X_05 = { {"X_05"}, 1 };
expression X_06 = { {"X_06"}, 1 };

expression a = ((X_06 & X_00) | (X_05 & X_01));
expression b = ((((X_05 & X_00) | (X_04 & X_01)) & (((X_04 & X_00) | (X_03 & X_01)) & ((X_01 & X_00) & (X_03 | X_02)))) | ((X_05 & X_00) & (X_04 & X_01)));
expression c = ~(a & b);
log("c = %s\n", c.to_string());

//crash too
a = ((X_06&X_00)|(X_05&X_01));
b = ((((X_05&X_00)|(X_04&X_01))&(((X_04&X_00)|(X_03&X_01))&((X_01&X_00)&(X_03|X_02))))|((X_05&X_00)&(X_04&X_01)));
c = ~(a&b);

Checking now, you can try removing the outer s() in simplifier/directives.hpp for now.

Could you try again and let me know if you still have issues with it? I've pushed a fix for all possible problems you can run into in this "form".

Outputs: c = ~(((X_06&X_00)|(X_05&X_01))&((((X_05&X_00)|(X_04&X_01))&(((X_04&X_00)|(X_03&X_01))&((X_01&X_00)&(X_03|X_02))))|((X_05&X_00)&(X_04&X_01))))

@zzz9328fb This actually still persists, real simplified version should have been c = (~((X_03&X_00)^(X_02&X_01))|(X_01&X_00)). Working on a fix...