[Beignet] [PATCH 2/3] GBE: Fix a potential issue if increase srcNum.
Ruiling Song
ruiling.song at intel.com
Thu Mar 6 00:14:20 PST 2014
If increase MAX_SRC_NUM for ir::Instruction, unpredicted behaviour may happen.
Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
backend/src/backend/gen_insn_selection.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index d5d86de..46f0123 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -229,6 +229,7 @@ namespace gbe
public:
INLINE SelectionDAG(const ir::Instruction &insn) :
insn(insn), mergeable(0), childNum(insn.getSrcNum()), isRoot(0) {
+ GBE_ASSERT(insn.getSrcNum() < 127);
for (uint32_t childID = 0; childID < childNum; ++childID)
this->child[childID] = NULL;
}
@@ -243,7 +244,7 @@ namespace gbe
/*! When sources have been overwritten, a child insn cannot be merged */
uint32_t mergeable:ir::Instruction::MAX_SRC_NUM;
/*! Number of children we have in the pattern */
- uint32_t childNum:4;
+ uint32_t childNum:7;
/*! A root must be generated, no matter what */
uint32_t isRoot:1;
};
--
1.7.9.5
More information about the Beignet
mailing list