aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-25 12:10:25 +0100
committermarha <marha@users.sourceforge.net>2013-11-25 12:10:25 +0100
commit0f333fb1102f4886a8ce39f3c09b12e89e5a7f19 (patch)
tree8239768e506a03837019c4f02c8ab949c04a0818 /mesalib/src/glsl
parent7dbaa1cffdf176f803f2c7069fb6810e16a86f72 (diff)
parenta473b885d641b9c1ea57f2ae53f9ba7f2958cce2 (diff)
downloadvcxsrv-0f333fb1102f4886a8ce39f3c09b12e89e5a7f19.tar.gz
vcxsrv-0f333fb1102f4886a8ce39f3c09b12e89e5a7f19.tar.bz2
vcxsrv-0f333fb1102f4886a8ce39f3c09b12e89e5a7f19.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libX11 xserver mesa libXinerama libXmu mkfontscale git update 25 nov 2013 Conflicts: libXinerama/src/Xinerama.c
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp10
-rw-r--r--mesalib/src/glsl/ralloc.c6
2 files changed, 14 insertions, 2 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 01280478c..43cf49745 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -696,9 +696,15 @@ validate_assignment(struct _mesa_glsl_parse_state *state,
* Note: Whole-array assignments are not permitted in GLSL 1.10, but this
* is handled by ir_dereference::is_lvalue.
*/
- if (is_initializer && lhs_type->is_unsized_array() && rhs->type->is_array()
+ if (lhs_type->is_unsized_array() && rhs->type->is_array()
&& (lhs_type->element_type() == rhs->type->element_type())) {
- return rhs;
+ if (is_initializer) {
+ return rhs;
+ } else {
+ _mesa_glsl_error(&loc, state,
+ "implicitly sized arrays cannot be assigned");
+ return NULL;
+ }
}
/* Check for implicit conversion in GLSL 1.20 */
diff --git a/mesalib/src/glsl/ralloc.c b/mesalib/src/glsl/ralloc.c
index e79dad764..36bc61fd0 100644
--- a/mesalib/src/glsl/ralloc.c
+++ b/mesalib/src/glsl/ralloc.c
@@ -53,8 +53,10 @@ _CRTIMP int _vscprintf(const char *format, va_list argptr);
struct ralloc_header
{
+#ifdef DEBUG
/* A canary value used to determine whether a pointer is ralloc'd. */
unsigned canary;
+#endif
struct ralloc_header *parent;
@@ -78,7 +80,9 @@ get_header(const void *ptr)
{
ralloc_header *info = (ralloc_header *) (((char *) ptr) -
sizeof(ralloc_header));
+#ifdef DEBUG
assert(info->canary == CANARY);
+#endif
return info;
}
@@ -117,7 +121,9 @@ ralloc_size(const void *ctx, size_t size)
add_child(parent, info);
+#ifdef DEBUG
info->canary = CANARY;
+#endif
return PTR_FROM_HEADER(info);
}