summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniform_initializers.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-05-26 15:53:00 -0700
committerMatt Turner <[email protected]>2016-07-26 12:12:27 -0700
commit149309a424ed8c19354fc2c5830f927787f02ccc (patch)
treefebae3cec225306a1292180f1299e69d50fcd2e3 /src/compiler/glsl/link_uniform_initializers.cpp
parentd1f6f656973a2e18641441e3c97b30799a82de52 (diff)
glsl: Avoid aliasing violations.
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_uniform_initializers.cpp')
-rw-r--r--src/compiler/glsl/link_uniform_initializers.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp
index effbb6aea0c..17660a75741 100644
--- a/src/compiler/glsl/link_uniform_initializers.cpp
+++ b/src/compiler/glsl/link_uniform_initializers.cpp
@@ -65,8 +65,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
break;
case GLSL_TYPE_DOUBLE:
/* XXX need to check on big-endian */
- storage[i * 2].u = *(uint32_t *)&val->value.d[i];
- storage[i * 2 + 1].u = *(((uint32_t *)&val->value.d[i]) + 1);
+ memcpy(&storage[i * 2].u, &val->value.d[i], sizeof(double));
break;
case GLSL_TYPE_BOOL:
storage[i].b = val->value.b[i] ? boolean_true : 0;