Skip to content

Commit 696e8b6

Browse files
driusanircmaxell
authored andcommitted
Fix function calls without enough parameters (#27)
Fix the instances where function calls weren't being passed as many parameters as the function requires.
1 parent 7c8699b commit 696e8b6

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.phan/config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
'PhanTypeMismatchArgument',
2323
'PhanUndeclaredFunction',
2424
'PhanUndeclaredStaticMethod',
25-
'PhanParamTooFew',
2625
'PhanUndeclaredConstant',
2726
'PhanTypeExpectedObjectPropAccess',
2827
'PhanUndeclaredTypeParameter',

lib/JIT/Variable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function castTo(int $type): self {
199199
$this->context,
200200
$type,
201201
self::KIND_VALUE,
202-
$this->context->builder->siToFp($this->value)
202+
$this->context->builder->siToFp($this->value, $this->context->getTypeFromString('double'))
203203
);
204204
case self::TYPE_NATIVE_BOOL:
205205
return new self(
@@ -219,7 +219,7 @@ public function castTo(int $type): self {
219219
$this->context,
220220
$type,
221221
self::KIND_VALUE,
222-
$this->context->builder->siToFp($this->value)
222+
$this->context->builder->siToFp($this->value, $this->context->getTypeFromString('double'))
223223
);
224224
case self::TYPE_NATIVE_LONG:
225225
return new self(
@@ -340,4 +340,4 @@ public function dimFetch(self $dim): Variable {
340340

341341
function type_pair(int $left, int $right): int {
342342
return ($left << 16) | $right;
343-
}
343+
}

lib/VM/Variable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public function unaryOp(int $opCode, Variable $expr): void {
515515
$this->float *= -1.0;
516516
return;
517517
} else {
518-
$this->castFrom(self::NUMERIC($expr));
518+
$this->castFrom(self::NUMERIC, $expr);
519519
goto restart;
520520
}
521521
break;

0 commit comments

Comments
 (0)