diff --git a/src/lang/passes/bytecode.cc b/src/lang/passes/bytecode.cc index 94c452c..77b5878 100644 --- a/src/lang/passes/bytecode.cc +++ b/src/lang/passes/bytecode.cc @@ -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]) >> diff --git a/src/rt/core.h b/src/rt/core.h index a36db45..c1d45f3 100644 --- a/src/rt/core.h +++ b/src/rt/core.h @@ -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) @@ -217,9 +217,9 @@ namespace rt::core return true; } - bool is_cown_aquired() override + bool is_cown_acquired() override { - return aquired; + return acquired; } }; diff --git a/src/rt/objects/dyn_object.h b/src/rt/objects/dyn_object.h index e4332c3..873a3e3 100644 --- a/src/rt/objects/dyn_object.h +++ b/src/rt/objects/dyn_object.h @@ -247,8 +247,7 @@ namespace rt::objects } obj->region.set_tag(ImmutableTag); - auto cown = obj->is_cown(); - return !cown; + return !obj->is_cown(); }); } @@ -261,13 +260,13 @@ namespace rt::objects { return false; } - virtual bool is_cown_aquired() + virtual bool is_cown_acquired() { assert(false && "should only be called on cowns"); } 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) diff --git a/src/rt/rt.cc b/src/rt/rt.cc index a7f2b08..0bd667a 100644 --- a/src/rt/rt.cc +++ b/src/rt/rt.cc @@ -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"); } diff --git a/src/rt/ui/mermaid.cc b/src/rt/ui/mermaid.cc index 2e78bec..17d59a5 100644 --- a/src/rt/ui/mermaid.cc +++ b/src/rt/ui/mermaid.cc @@ -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) diff --git a/tests/valid_cowns.vpy b/tests/valid_cowns.vpy index 56093a7..28f7b55 100644 --- a/tests/valid_cowns.vpy +++ b/tests/valid_cowns.vpy @@ -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