diff --git a/genapi/src/elem_type.rs b/genapi/src/elem_type.rs index 83a252b..306b7d3 100644 --- a/genapi/src/elem_type.rs +++ b/genapi/src/elem_type.rs @@ -312,7 +312,7 @@ impl RegPIndex { let base = self.p_index.value(device, store, cx)?; if let Some(offset) = &self.offset { let offset: i64 = offset.value(device, store, cx)?; - Ok(base + offset) + Ok(base * offset) } else { Ok(base) } diff --git a/genapi/src/parser/integer.rs b/genapi/src/parser/integer.rs index 8425a54..8f6f347 100644 --- a/genapi/src/parser/integer.rs +++ b/genapi/src/parser/integer.rs @@ -45,7 +45,7 @@ impl Parse for IntegerNode { let inc = node .parse_if(INC, node_builder, value_builder, cache_builder) .or_else(|| node.parse_if(P_INC, node_builder, value_builder, cache_builder)) - .unwrap_or(ImmOrPNode::Imm(10)); + .unwrap_or(ImmOrPNode::Imm(1)); let unit = node.parse_if(UNIT, node_builder, value_builder, cache_builder); let representation: IntegerRepresentation = node .parse_if(REPRESENTATION, node_builder, value_builder, cache_builder)