From bf9c95f5c9acd97a8b28572ffa1136ca93f7328f Mon Sep 17 00:00:00 2001 From: Daniel Lupu Date: Sun, 27 Nov 2022 17:52:52 +0200 Subject: [PATCH] process some of the feedback --- test/tools/yulopti.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp index 55b8b1ca9..db39edb07 100644 --- a/test/tools/yulopti.cpp +++ b/test/tools/yulopti.cpp @@ -100,8 +100,13 @@ public: auto scanner = make_shared(charStream); if (!m_inputIsCodeBlock && scanner->currentToken() == Token::LBrace) + { m_inputIsCodeBlock = true; + if (!_objectPath.empty()) + throw runtime_error("Object path argument cannot be used. Input is a code block."); + } + shared_ptr object = parser.parse(scanner, false); if (!object || !errorReporter.errors().empty()) @@ -262,8 +267,14 @@ public: { if (!m_inputIsCodeBlock) cout << m_object->toString(&m_dialect) << endl; - else + else { + yulAssert( + m_object->subObjects.empty(), + "Unexpected subObjects found." + ); + cout << AsmPrinter{m_dialect}(*m_object->code) << endl; + } } void resetNameDispenser()