From e7bae8f3f2188c6b04e4f4d62e898275f072a6e3 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 28 Sep 2016 10:35:32 +0800 Subject: AST - Make anon modules `shared_ptr`s to handle case where a block is depeted --- src/resolve/use.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/resolve/use.cpp') diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 44d50516..c2079bdd 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -256,7 +256,8 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path if( idx >= mod.anon_mods().size() ) { BUG(span, "Invalid anon path segment '" << des_item_name << "'"); } - return ::AST::PathBinding::make_Module({mod.anon_mods()[idx]}); + assert( mod.anon_mods()[idx] ); + return ::AST::PathBinding::make_Module({&*mod.anon_mods()[idx]}); } // Seach for the name defined in the module. -- cgit v1.2.3