Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
5efb004d
Unverified
Commit
5efb004d
authored
Mar 19, 2019
by
John Kessenich
Committed by
GitHub
Mar 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1711 from demett-brcm/avoid-undefined-behaviour
Avoid undefined behaviour
parents
e442a038
0b018419
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+5
-1
No files found.
glslang/MachineIndependent/intermOut.cpp
View file @
5efb004d
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#else
#else
#include <cmath>
#include <cmath>
#endif
#endif
#include <cstdint>
namespace
{
namespace
{
...
@@ -1162,8 +1163,11 @@ static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraO
...
@@ -1162,8 +1163,11 @@ static void OutputDouble(TInfoSink& out, double value, TOutputTraverser::EExtraO
switch
(
extra
)
{
switch
(
extra
)
{
case
TOutputTraverser
:
:
BinaryDoubleOutput
:
case
TOutputTraverser
:
:
BinaryDoubleOutput
:
{
{
uint64_t
b
;
static_assert
(
sizeof
(
b
)
==
sizeof
(
value
),
"sizeof(uint64_t) != sizeof(double)"
);
memcpy
(
&
b
,
&
value
,
sizeof
(
b
));
out
.
debug
<<
" : "
;
out
.
debug
<<
" : "
;
long
long
b
=
*
reinterpret_cast
<
long
long
*>
(
&
value
);
for
(
size_t
i
=
0
;
i
<
8
*
sizeof
(
value
);
++
i
,
++
b
)
{
for
(
size_t
i
=
0
;
i
<
8
*
sizeof
(
value
);
++
i
,
++
b
)
{
out
.
debug
<<
((
b
&
0x8000000000000000
)
!=
0
?
"1"
:
"0"
);
out
.
debug
<<
((
b
&
0x8000000000000000
)
!=
0
?
"1"
:
"0"
);
b
<<=
1
;
b
<<=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment