From 262655e2e0ca1b5a7404e6983f2e98b19944badb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 16 Oct 2016 22:22:03 +0200 Subject: [PATCH] Validate access to functionNames # Conflicts: # test/testpaint/Printer.cpp --- test/testpaint/Printer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testpaint/Printer.cpp b/test/testpaint/Printer.cpp index 03966d128c..31d5d75e09 100644 --- a/test/testpaint/Printer.cpp +++ b/test/testpaint/Printer.cpp @@ -16,6 +16,7 @@ #include "Printer.hpp" #include "String.hpp" +#include "../../src/core/Util.hpp" namespace Printer { @@ -28,6 +29,7 @@ namespace Printer { "metal_b_supports_paint_setup", "wooden_a_supports_paint_setup", "wooden_b_supports_paint_setup", + "paint_util_set_segment_support_height", }; static std::string GetImageIdString(uint32 imageId); @@ -51,6 +53,7 @@ namespace Printer { std::string PrintFunctionCall(function_call call, uint16 baseHeight) { std::string imageId = GetImageIdString(call.supports.colour_flags); + assert(call.function < Util::CountOf(functionNames)); const char *functionName = functionNames[call.function]; switch (call.function) {