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

[Bugfix] Fixed crash caused by reversing bitwise operations #4852

Merged
merged 1 commit into from Feb 10, 2020
Merged

[Bugfix] Fixed crash caused by reversing bitwise operations #4852

merged 1 commit into from Feb 10, 2020

Conversation

dpankratz
Copy link
Contributor

@dpankratz dpankratz commented Feb 9, 2020

I ran into a bug when using the bitwise operators bitwise_xor, bitwise_and, and bitwise_or.

The following code results in a Python TypeError:

a = tvm.var()
b = 10 ^ a 

For reference this code is accepted:

a = tvm.var()
b = a ^ 10

Analogous crashes occur for the case of 10 | a and 10 & a.

This pull requests fixes this crash for the operators bitwise_xor, bitwise_and, and bitwise_or. It also adds a regression test.

cc @tqchen @inadob @ZihengJiang

…c python type was on the left hand side of the expression. Added regression test for crashing cases.
@dpankratz dpankratz changed the title [Bugfix] Fixed crash when caused by reversing bitwise operators [Bugfix] Fixed crash caused by reversing bitwise operators Feb 9, 2020
@dpankratz dpankratz changed the title [Bugfix] Fixed crash caused by reversing bitwise operators [Bugfix] Fixed crash caused by reversing bitwise operations Feb 9, 2020
@tqchen tqchen added status: need test case need test cases to cover the change status: accepted and removed status: need test case need test cases to cover the change labels Feb 10, 2020
@tqchen tqchen merged commit d55e21f into apache:master Feb 10, 2020
@tqchen
Copy link
Member

tqchen commented Feb 10, 2020

Thanks @dpankratz !

alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
…c python type was on the left hand side of the expression. Added regression test for crashing cases. (apache#4852)
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
…c python type was on the left hand side of the expression. Added regression test for crashing cases. (apache#4852)
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
…c python type was on the left hand side of the expression. Added regression test for crashing cases. (apache#4852)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants