vtil-project / VTIL-Core

Virtual-machine Translation Intermediate Language
BSD 3-Clause "New" or "Revised" License
1.31k stars 165 forks source link

Stack overflow during simpilfication. #2 #8

Closed zzz9328fb closed 4 years ago

zzz9328fb commented 4 years ago
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());
zzz9328fb commented 4 years ago

//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);

can1357 commented 4 years ago

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

can1357 commented 4 years ago

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))))

can1357 commented 4 years ago

@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...