diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2012-08-09 11:07:10 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-10 10:10:16 -0500 |
| commit | da472c60655393f0bb49113713a8be2bdd2a9b6f (patch) | |
| tree | f9915dc5214d6adabc6721f1b2090718f1a02754 /src/usr/util | |
| parent | bf8845174080ea8c793eed091c40ae6b818959fd (diff) | |
| download | blackbird-hostboot-da472c60655393f0bb49113713a8be2bdd2a9b6f.tar.gz blackbird-hostboot-da472c60655393f0bb49113713a8be2bdd2a9b6f.zip | |
Error in UtilFile.
Due to using the copy constructor when creating the UtilMem wrapper
around a Hostboot file, we end up (temporarily) with two UtilMem
objects pointing to the same buffer. Use in-place constructor
instead so there is only ever one UtilMem instance.
Change-Id: I632a5914bb1a9c28268be802771b55aa2dc0d8e0
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1506
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/util')
| -rw-r--r-- | src/usr/util/utilfile.C | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/usr/util/utilfile.C b/src/usr/util/utilfile.C index 52c63420f..dde0a5ab8 100644 --- a/src/usr/util/utilfile.C +++ b/src/usr/util/utilfile.C @@ -143,7 +143,8 @@ void UtilFile::Open( } // Create UtilMem object to overlay module location in memory. - iv_contents = UtilMem(const_cast<char*>(l_address), l_size); + iv_contents.~UtilMem(); + new (&iv_contents) UtilMem(const_cast<char*>(l_address), l_size); iv_eof = iv_contents.eof(); iv_lastError = iv_contents.getLastError(); |

