Skip to content

Commit

Permalink
PR: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xFrednet committed Oct 19, 2024
1 parent e9a0a8b commit f312966
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/lang/passes/bytecode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ PassDef bytecode()

T(Compile) << (T(Taint)[Op] << T(Ident)[Ident]) >>
[](auto& _) {
return Seq << (Compile << _[Ident]) << create_from(Taint, _(Op));
auto print_str = std::string(create_print(_(Op))->location().view());
return Seq << (Compile << _[Ident]) << (Taint ^ print_str);
},

T(Compile) << (T(DestructiveRead) << T(Ident)[Ident]) >>
Expand Down
6 changes: 3 additions & 3 deletions src/rt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ namespace rt::core
{
// For now always false, but might be needed later if we want to simulate
// concurrency.
bool aquired = false;
bool acquired = false;

public:
CownObject(objects::DynObject* region)
Expand Down Expand Up @@ -217,9 +217,9 @@ namespace rt::core
return true;
}

bool is_cown_aquired() override
bool is_cown_acquired() override
{
return aquired;
return acquired;
}
};

Expand Down
10 changes: 5 additions & 5 deletions src/rt/objects/dyn_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ namespace rt::objects
}
obj->region.set_tag(ImmutableTag);

auto cown = obj->is_cown();
return !cown;
return !obj->is_cown();
});
}

Expand All @@ -261,13 +260,14 @@ namespace rt::objects
{
return false;
}
virtual bool is_cown_aquired()
virtual bool is_cown_acquired()
{
assert(false && "should only be called on cowns");
ui::error("is_cown_acquired() should only be called on cowns");
return false;
}
bool is_opaque()
{
return this->is_cown() && !this->is_cown_aquired();
return this->is_cown() && !this->is_cown_acquired();
}

[[nodiscard]] DynObject* get(std::string name)
Expand Down
2 changes: 1 addition & 1 deletion src/rt/rt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace rt
if (obj->is_opaque())
{
// Overwriting data can change the RC and then call destructors of the
// type this action therefore requires the cown to be aquired
// type this action therefore requires the cown to be acquired
ui::error("opaque objects can't be modified");
}

Expand Down
2 changes: 1 addition & 1 deletion src/rt/ui/mermaid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace rt::ui
out << "class id" << visited[dst] << " tainted;" << std::endl;
tainted.insert(dst);

return dst->is_opaque();
return !dst->is_opaque();
};

for (auto root : *taint)
Expand Down
4 changes: 0 additions & 4 deletions tests/valid_cowns.vpy
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ taint global
# Freeze global with a cown
freeze global

# FIXME: traint with cowns is wrong
# FIXME: Show local region address
# FIXME: Cowns should have special rendering and out edges

drop c01
drop global

0 comments on commit f312966

Please sign in to comment.