* fixes #13744

* improve style

Co-authored-by: cooldome <ariabushenko@gmail.ru>
This commit is contained in:
cooldome 2020-03-25 13:44:52 +00:00 • committed by GitHub
commit 182d3c16e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 1 deletions

View file

@ -463,6 +463,12 @@ proc opConv(c: PCtx; dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType):
value = (value shl srcDist) shr srcDist
value = (value shl destDist) shr destDist
dest.intVal = cast[BiggestInt](value)
of tyBool:
dest.ensureKind(rkInt)
dest.intVal =
case skipTypes(srctyp, abstractRange).kind
of tyFloat..tyFloat64: int(src.floatVal != 0.0)
else: int(src.intVal != 0)
of tyFloat..tyFloat64:
dest.ensureKind(rkFloat)
case skipTypes(srctyp, abstractRange).kind