facebook / facebook/hhvm

Incorrect LSB for __Memoize on static functions

Open
#4,962 0 comments 0 reactions 0 assignees View on GitHub
hack probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

``` Hack
>
protected static function doStuff() {
var_dump(static::class);
}
}

class B extends A {
public static function doOtherStuff() {
self::doStuff();
}
}

B::doOtherStuff();
```

Actual output: A
Expected output: B

From bytecode:

```
55: FPushClsMethodD 0 "doStuff$memoize_impl" "A"
```

This should be FPushClsMethodF.

The user still needs to be careful about the shared cache between the superclass and child class

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.