Commit 45ee87e2 by Gert Wollny Committed by Angle LUCI CQ

Capture/Replay: Don't try to serialize blob without data

The construct std::vector v; &v[0] doesn't go well with a checked STL, because the element 0 doesn't exists in an empty vector, and obviously it doesn't know that whether the pointer gets de-referenced later. Bug: angleproject:5980 Change-Id: I690c99bd12d74112fe1081ea3134b6ffb11ad23b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2900226Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
parent 6622d2b4
...@@ -93,7 +93,14 @@ class JsonSerializer : public angle::NonCopyable ...@@ -93,7 +93,14 @@ class JsonSerializer : public angle::NonCopyable
template <typename T> template <typename T>
void addVectorAsHash(const std::string &name, const std::vector<T> &value) void addVectorAsHash(const std::string &name, const std::vector<T> &value)
{ {
addBlob(name, reinterpret_cast<const uint8_t *>(&value[0]), value.size() * sizeof(T)); if (!value.empty())
{
addBlob(name, reinterpret_cast<const uint8_t *>(&value[0]), value.size() * sizeof(T));
}
else
{
addCString(name, "null");
}
} }
void addVectorOfStrings(const std::string &name, const std::vector<std::string> &value); void addVectorOfStrings(const std::string &name, const std::vector<std::string> &value);
......
...@@ -28,6 +28,9 @@ IndexBufferOffsetTest.UInt32IndexSmallUpdates/* ...@@ -28,6 +28,9 @@ IndexBufferOffsetTest.UInt32IndexSmallUpdates/*
IndexBufferOffsetTest.UInt8Index/* IndexBufferOffsetTest.UInt8Index/*
IndexBufferOffsetTest.UInt8IndexSmallUpdates/* IndexBufferOffsetTest.UInt8IndexSmallUpdates/*
# Flanky tests, pass standalone, but fail in a group
ColorMaskTest.AMDZeroColorMaskBug/ES3_OpenGL
# Has undefined framebuffer pixels. This fails comparison checks. # Has undefined framebuffer pixels. This fails comparison checks.
SimpleOperationTest.ClearAndSwap/* SimpleOperationTest.ClearAndSwap/*
SimpleOperationTest.DrawQuadAndSwap/* SimpleOperationTest.DrawQuadAndSwap/*
...@@ -36,7 +39,6 @@ SimpleOperationTest.DrawQuadAndSwap/* ...@@ -36,7 +39,6 @@ SimpleOperationTest.DrawQuadAndSwap/*
BlitFramebufferANGLETest.* BlitFramebufferANGLETest.*
BufferDataTest.* BufferDataTest.*
ClipDistanceTest.* ClipDistanceTest.*
ColorMaskTest.*
CopyCompressedTextureTest.InternalFormat/* CopyCompressedTextureTest.InternalFormat/*
DebugMarkerTest.* DebugMarkerTest.*
DebugTest.* DebugTest.*
......
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