From bd1e66dd1117701aecdea8406ae5e9e9ec4ed7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 25 Mar 2015 11:52:24 +0100 Subject: [PATCH] Code cleanup --- evmjit/libevmjit/ExecutionEngine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evmjit/libevmjit/ExecutionEngine.cpp b/evmjit/libevmjit/ExecutionEngine.cpp index c00691f3e..ce1f530d7 100644 --- a/evmjit/libevmjit/ExecutionEngine.cpp +++ b/evmjit/libevmjit/ExecutionEngine.cpp @@ -91,10 +91,11 @@ void parseOptions() // "source" scheduler has a bug: http://llvm.org/bugs/show_bug.cgi?id=22304 auto envLine = std::getenv("EVMJIT"); auto commandLine = std::string{"evmjit "} + (envLine ? envLine : "") + " -pre-RA-sched=list-burr\0"; - char const* argv[100] = {nullptr, }; + static const auto c_maxArgs = 20; + char const* argv[c_maxArgs] = {nullptr, }; auto arg = std::strtok(&*commandLine.begin(), " "); auto i = 0; - for (; i < sizeof(argv) / sizeof(argv[0]) && arg; ++i, arg = std::strtok(nullptr, " ")) + for (; i < c_maxArgs && arg; ++i, arg = std::strtok(nullptr, " ")) argv[i] = arg; cl::ParseCommandLineOptions(i, argv, "Ethereum EVM JIT Compiler"); }