Fix a bug in preOptimizeStLoc
commit93733eed2d84876e7ea95e813d58a50a97ceaa2c
authorJordan DeLong <jdelong@fb.com>
Sun, 15 Dec 2013 01:34:48 +0000 (14 17:34 -0800)
committerSara Golemon <sgolemon@fb.com>
Wed, 18 Dec 2013 19:41:17 +0000 (18 11:41 -0800)
tree53ed98f7ca35938c3303f5a13728a86159846205
parentca5dfe2457bbcd996c22ab6ced1232d79b20225a
Fix a bug in preOptimizeStLoc

With the control-flow sensitive local type inference in
hhbbc, a local was being asserted as Type::Null.  Because
isKnownDataType returned true, preOptimizeStLoc decided that
converting that local from KindOfUninit (the actual live type) to
KindOfNull did not require storing a new m_type value, leading to a
crash down the line in the next translation.  I tried cleaning up
isKnownDataType but too many things depend on it (also it's a little
conceptually shaky because of how we deal with Str), so for now tasked
and just fixed this function.

Reviewed By: @swtaarrs

Differential Revision: D1099460
hphp/runtime/vm/jit/test/type.cpp
hphp/runtime/vm/jit/trace-builder.cpp
hphp/runtime/vm/jit/translator.cpp
hphp/runtime/vm/jit/type.h