This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][MIPS] Fix TestReturnValue failure for MIPS
ClosedPublic

Authored by nitesh.jain on Sep 13 2016, 3:21 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

nitesh.jain retitled this revision from to [LLDB][MIPS] Fix TestReturnValue failure for MIPS.
nitesh.jain updated this object.
nitesh.jain added reviewers: clayborg, labath, bhushan.
nitesh.jain added inline comments.Sep 13 2016, 3:39 AM
source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
972 ↗(On Diff #71131)

The issued was while setting f0_data and f2_data successively via RegisterValue.GetData. Since RegisterValue.GetData() will internally call Scalar::GetBytes() which contain static member (flt_val and db1_val) for floating point type . Hence two successive calls to set data for m_type float/double will cause the content of f0_data to be overwritten with the content of f2_value.

Scalar::GetBytes() const
{

const uint64_t *apint_words;
const uint8_t *bytes;
static float_t flt_val;
static double_t dbl_val;
static uint64_t swapped_words[4];

...
...
...

}

bhushan accepted this revision.Sep 30 2016, 2:47 AM
bhushan edited edge metadata.

Looks good as far as correctness is concerned.

This revision is now accepted and ready to land.Sep 30 2016, 2:47 AM
clayborg accepted this revision.Oct 10 2016, 9:50 AM
clayborg edited edge metadata.
This revision was automatically updated to reflect the committed changes.