Calculate default mask shift properly

#KT-18689 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-06-28 14:22:34 +02:00
parent 1fa7193901
commit 4f914fafca
12 changed files with 260 additions and 1 deletions
@@ -366,7 +366,9 @@ abstract class InlineCodegen<out T: BaseExpressionCodegen>(
assert(constantValue is Int) { "Mask should be of Integer type, but " + constantValue }
maskValues.add(constantValue as Int)
if (maskStartIndex == -1) {
maskStartIndex = invocationParamBuilder.nextParameterOffset
maskStartIndex = invocationParamBuilder.listAllParams().sumBy {
if (it is CapturedParamInfo) 0 else it.type.size
}
}
}
else {