Skip to content

Commit

Permalink
ir: fix type assert issue in gepInstType where index would always be …
Browse files Browse the repository at this point in the history
…nil in else-branch

ref: #116 (comment)
  • Loading branch information
mewmew committed Dec 13, 2019
1 parent b85ca17 commit c2b2298
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ir/inst_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,10 @@ func gepInstType(elemType, src types.Type, indices []value.Value) types.Type {
var idxs []gep.Index
for _, index := range indices {
var idx gep.Index
if index, ok := index.(constant.Constant); ok {
switch index := index.(type) {
case constant.Constant:
idx = getIndex(index)
} else {
default:
idx = gep.Index{HasVal: false}
// Check if index is of vector type.
if indexType, ok := index.Type().(*types.VectorType); ok {
Expand Down

0 comments on commit c2b2298

Please sign in to comment.