decomp: generic (#611)

* decomp: Fix casting issue with uint64's from static data

* decomp: `generic`

* add forward declaration

Co-authored-by: water111 <48171810+water111@users.noreply.github.com>
This commit is contained in:
Tyler Wilding
2021-06-20 16:02:15 -04:00
committed by GitHub
parent 4f8403d8e6
commit 87961bdb3b
11 changed files with 328 additions and 20 deletions
+5 -3
View File
@@ -642,8 +642,10 @@ Form* LoadVarOp::get_load_src(FormPool& pool, const Env& env) const {
u64 value;
memcpy(&value, &word0.data, 4);
memcpy(((u8*)&value) + 4, &word1.data, 4);
return pool.alloc_single_element_form<SimpleAtomElement>(
nullptr, SimpleAtom::make_int_constant(value));
return pool.alloc_single_element_form<CastElement>(
nullptr, TypeSpec("uint"),
pool.alloc_single_element_form<SimpleAtomElement>(
nullptr, SimpleAtom::make_int_constant(value)));
}
// is it a constant bitfield?
@@ -797,4 +799,4 @@ FormElement* StackSpillStoreOp::get_as_form(FormPool& pool, const Env& env) cons
return pool.alloc_element<StackSpillStoreElement>(m_value, m_size, m_offset, cast_type);
}
} // namespace decompiler
} // namespace decompiler