mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
fix shl by 16 constant being mistaken for a dynamic bitfield construction (#600)
This commit is contained in:
parent
d26de26d21
commit
af49ac60cd
|
@ -581,6 +581,19 @@ std::optional<u64> get_goal_integer_constant(Form* in, const Env&) {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// also (shl <something> 16)
|
||||
matcher = Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::SHL),
|
||||
{Matcher::any(1), Matcher::integer(16)});
|
||||
mr = match(matcher, in);
|
||||
if (mr.matched) {
|
||||
auto arg_as_atom = form_as_atom(mr.maps.forms.at(1));
|
||||
if (arg_as_atom && arg_as_atom->is_int()) {
|
||||
u64 result = arg_as_atom->get_int();
|
||||
result <<= 16ull;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue