Commit a9da3d38 authored by Victor Zverovich's avatar Victor Zverovich

Fix ArgList::operator[]

parent b2bd63d2
...@@ -897,13 +897,15 @@ class ArgList { ...@@ -897,13 +897,15 @@ class ArgList {
*/ */
internal::Arg operator[](unsigned index) const { internal::Arg operator[](unsigned index) const {
using internal::Arg; using internal::Arg;
if (index >= MAX_ARGS) Arg arg;
return Arg(); if (index >= MAX_ARGS) {
arg.type = Arg::NONE;
return arg;
}
unsigned shift = index * 4; unsigned shift = index * 4;
uint64_t mask = 0xf; uint64_t mask = 0xf;
Arg::Type type = Arg::Type type =
static_cast<Arg::Type>((types_ & (mask << shift)) >> shift); static_cast<Arg::Type>((types_ & (mask << shift)) >> shift);
Arg arg;
arg.type = type; arg.type = type;
if (type != Arg::NONE) { if (type != Arg::NONE) {
internal::Value &value = arg; internal::Value &value = arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment