mirror of
https://github.com/open-goal/jak-project
synced 2026-08-11 03:26:33 -04:00
[Decompile] connect, text-h, settings-h, capture, memory-usage-h (#410)
* decompile stuff * temp * temp2 * fix * temp * preparing for merge * working * fix stupid format * fix codacy
This commit is contained in:
@@ -742,13 +742,20 @@ FormElement* StackSpillLoadOp::get_as_form(FormPool& pool, const Env& env) const
|
||||
}
|
||||
|
||||
FormElement* StackSpillStoreOp::get_as_form(FormPool& pool, const Env& env) const {
|
||||
auto& slot_type = env.stack_slot_entries.at(m_offset).typespec;
|
||||
auto src_type = env.get_types_before_op(m_my_idx).get(m_value.reg()).typespec();
|
||||
std::optional<TypeSpec> cast_type;
|
||||
|
||||
if (!env.dts->ts.tc(slot_type, src_type)) {
|
||||
// we fail the typecheck for a normal set!, so add a cast.
|
||||
cast_type = slot_type;
|
||||
// if we aren't a var, we're 0.
|
||||
TypeSpec src_type = TypeSpec("int");
|
||||
if (m_value.is_var() && env.has_type_analysis()) {
|
||||
src_type = env.get_types_before_op(m_my_idx).get(m_value.var().reg()).typespec();
|
||||
}
|
||||
|
||||
auto kv = env.stack_slot_entries.find(m_offset);
|
||||
if (kv != env.stack_slot_entries.end()) {
|
||||
if (!env.dts->ts.tc(kv->second.typespec, src_type)) {
|
||||
// we fail the typecheck for a normal set!, so add a cast.
|
||||
cast_type = kv->second.typespec;
|
||||
}
|
||||
}
|
||||
|
||||
return pool.alloc_element<StackSpillStoreElement>(m_value, m_size, m_offset, cast_type);
|
||||
|
||||
Reference in New Issue
Block a user