diff options
author | Matt Turner <[email protected]> | 2016-05-26 15:53:00 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2016-07-26 12:12:27 -0700 |
commit | 149309a424ed8c19354fc2c5830f927787f02ccc (patch) | |
tree | febae3cec225306a1292180f1299e69d50fcd2e3 /src/compiler/glsl/link_uniform_initializers.cpp | |
parent | d1f6f656973a2e18641441e3c97b30799a82de52 (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.cpp | 3 |
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; |