Revert "orcprogram-c: avoid running out of bounds of varnames"
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Wed, 17 Feb 2016 15:05:49 +0000 (15:05 +0000)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Wed, 17 Feb 2016 15:05:49 +0000 (15:05 +0000)
This reverts commit 951091788b8496868bf86b2f853f5214659e782a.

This isn't a proper fix and the risk of bringing in a regression is too
high for the small and incomplete improvement.

orc/orclimits.h
orc/orcprogram-c.c

index 18f1d9e..928b00c 100644 (file)
@@ -15,7 +15,6 @@ ORC_BEGIN_DECLS
 #define ORC_N_CONSTANTS 20
 #define ORC_N_LABELS 40
 #define ORC_N_COMPILER_VARIABLES (ORC_N_VARIABLES+32)
-#define ORC_N_VARNAMES 48
 
 #define ORC_GP_REG_BASE 32
 #define ORC_VEC_REG_BASE 64
index 43cfaed..bff075a 100644 (file)
@@ -291,7 +291,7 @@ orc_compiler_c_assemble (OrcCompiler *compiler)
     ORC_ASM_CODE(compiler,"  for (j = 0; j < m; j++) {\n");
     prefix = 2;
 
-    for(i=0;i<ORC_N_VARNAMES;i++){
+    for(i=0;i<ORC_N_COMPILER_VARIABLES;i++){
       OrcVariable *var = compiler->vars + i;
       if (var->name == NULL) continue;
       switch (var->vartype) {
@@ -417,7 +417,7 @@ orc_compiler_c_assemble (OrcCompiler *compiler)
     ORC_ASM_CODE(compiler,"  }\n");
   }
 
-  for(i=0;i<ORC_N_VARNAMES;i++){
+  for(i=0;i<ORC_N_COMPILER_VARIABLES;i++){
     char varname[40];
     OrcVariable *var = compiler->vars + i;
     if (var->name == NULL) continue;