forked from OSchip/llvm-project
Fix undefined behaviour in data formatter test -- ensure char* null-terminated
so LLDB does not read off the end of the array. llvm-svn: 184877
This commit is contained in:
parent
2f0d590713
commit
795cc3afc3
|
@ -61,8 +61,11 @@ struct SimpleWithPointers
|
|||
SimpleWithPointers(int X, float Y, char Z) :
|
||||
x(new int (X)),
|
||||
y(new float (Y)),
|
||||
z(new char (Z))
|
||||
{}
|
||||
z(new char[2])
|
||||
{
|
||||
z[0] = Z;
|
||||
z[1] = '\0';
|
||||
}
|
||||
};
|
||||
|
||||
struct Couple
|
||||
|
@ -168,4 +171,4 @@ int main (int argc, const char * argv[])
|
|||
VeryLong a_long_guy;
|
||||
|
||||
return 0; // Set break point at this line.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue