learning-gem5: Use zero initialization in hello_goodbye test
This is likely fixing: JIRA: https://gem5.atlassian.net/browse/GEM5-328 the exitCause method was randomically printing an invalid string coming from a non 0 terminated char buffer, whose pointer is provided via the exitSimLoop. By doing zero-initialization we make sure last character is '\0'. Change-Id: I514a9bd240a0d5489ce9652ad14289f834752abe Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25987 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -36,7 +36,7 @@ GoodbyeObject::GoodbyeObject(GoodbyeObjectParams *params) :
|
||||
bandwidth(params->write_bandwidth), bufferSize(params->buffer_size),
|
||||
buffer(nullptr), bufferUsed(0)
|
||||
{
|
||||
buffer = new char[bufferSize];
|
||||
buffer = new char[bufferSize]();
|
||||
DPRINTF(HelloExample, "Created the goodbye object\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user