From 32f53e249e619912c35abcf5adc65d08575a16f7 Mon Sep 17 00:00:00 2001 From: Brian Huffman Date: Sun, 17 May 2020 22:05:00 -0700 Subject: [PATCH] Implement missing case in LLVM `matchArg` function for array values. Fixes #701. --- src/SAWScript/Crucible/LLVM/Override.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SAWScript/Crucible/LLVM/Override.hs b/src/SAWScript/Crucible/LLVM/Override.hs index 85e59534ba..0a943be064 100644 --- a/src/SAWScript/Crucible/LLVM/Override.hs +++ b/src/SAWScript/Crucible/LLVM/Override.hs @@ -995,6 +995,12 @@ matchArg opts sc cc cs prepost actual expectedTy expected = do realTerm <- valueToSC sym (cs ^. MS.csLoc) failMsg tval actual matchTerm sc cc (cs ^. MS.csLoc) prepost realTerm (ttTerm expectedTT) + -- match arrays point-wise + (Crucible.LLVMValArray _ xs, Crucible.ArrayType _len y, SetupArray () zs) -> + sequence_ + [ matchArg opts sc cc cs prepost x y z + | (x, z) <- zip (V.toList xs) zs ] + -- match the fields of struct point-wise (Crucible.LLVMValStruct xs, Crucible.StructType fields, SetupStruct () _ zs) -> sequence_