Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

invariant: Not recorded immutable binding recorded by havocing #2442

Closed
calebmer opened this issue Aug 17, 2018 · 0 comments
Closed

invariant: Not recorded immutable binding recorded by havocing #2442

calebmer opened this issue Aug 17, 2018 · 0 comments
Assignees

Comments

@calebmer
Copy link
Contributor

Error

Invariant Violation: 
debug-fb-www.js:212
This is likely a bug in Prepack, not your code. Feel free to open an issue on GitHub.
    at invariant (/Users/calebmer/prepack/src/invariant.js:18:15)
    at DeclarativeEnvironmentRecord.GetBindingValue (/Users/calebmer/prepack/src/environment.js:353:17)
    at EnvironmentImplementation._dereference (/Users/calebmer/prepack/src/methods/environment.js:252:19)
    at EnvironmentImplementation.GetValue (/Users/calebmer/prepack/src/methods/environment.js:197:20)
    at evaluateReference (/Users/calebmer/prepack/src/evaluators/CallExpression.js:128:26)
    at _default (/Users/calebmer/prepack/src/evaluators/CallExpression.js:62:12)
    at LexicalEnvironment.evaluateAbstract (/Users/calebmer/prepack/src/environment.js:1382:20)
    at LexicalEnvironment.evaluate (/Users/calebmer/prepack/src/environment.js:1370:20)
    at _default (/Users/calebmer/prepack/src/evaluators/BinaryExpression.js:41:18)
    at LexicalEnvironment.evaluateAbstract (/Users/calebmer/prepack/src/environment.js:1382:20)

Input

const havoc = __abstract("function", "(() => {})");

global.result = __evaluatePureFunction(() => {
  const b = __abstract("boolean", "true");

  if (b) {
    var g = function f(i) {
      return i === 0 ? 0 : f(i - 1) + 1;
    };
    havoc(g);
  } else {
    return;
  }

  return g(5);
});
@calebmer calebmer self-assigned this Aug 17, 2018
facebook-github-bot pushed a commit that referenced this issue Aug 22, 2018
Summary:
Fixes #2419 #2386 #2439 #2447 #2432 #2437 #2442

* Fix havoced binding not in optimized function
* Allow arrays with widened numeric properties to update index properties
* Fix nested for statement bailout with nested for-in
* Don’t record modified bindings for immutable bindings when havocing

Reviewed By: trueadm, sebmarkbage

Differential Revision: D9456957

fbshipit-source-id: f266b8cc73012b9c721f0f9eebd48347bf0e37ae
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant