From a9da3d38522e01c5edac96d02a61598bc7400f86 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 25 Sep 2014 09:31:36 -0700 Subject: [PATCH] Fix ArgList::operator[] --- format.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/format.h b/format.h index da5f912b..580a7966 100644 --- a/format.h +++ b/format.h @@ -897,13 +897,15 @@ class ArgList { */ internal::Arg operator[](unsigned index) const { using internal::Arg; - if (index >= MAX_ARGS) - return Arg(); + Arg arg; + if (index >= MAX_ARGS) { + arg.type = Arg::NONE; + return arg; + } unsigned shift = index * 4; uint64_t mask = 0xf; Arg::Type type = static_cast((types_ & (mask << shift)) >> shift); - Arg arg; arg.type = type; if (type != Arg::NONE) { internal::Value &value = arg;