Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix error variable 'td' is uninitialized #8299

Merged
merged 1 commit into from
Nov 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/debug/di/rsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ void CordbThread::Get32bitFPRegisters(CONTEXT * pContext)

for (i = 0; i <= floatStackTop; i++)
{
long double td;
double td = 0.0;
__asm fstp td // copy out the double
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this inline assembly compile on Unix? I would expect that this whole block will need #ifdef _MSCVER to differentiate between Windows-style inline assembly and Unix-style inline assembly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to compile with clang3.8, which I'm using.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just initialize it unconditionally to 0, even on Windows - no need for ifdef.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple test code doesn't seem to compile. I need to check.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for information, clang simple test code with -fasm-blocks passes compilation.

m_floatValues[i] = td;
}
Expand Down