[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:
water111
2021-05-05 17:38:16 -04:00
committed by GitHub
parent 8d99bee88c
commit 0a6602e320
41 changed files with 4626 additions and 369 deletions
+12 -5
View File
@@ -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);