Comments (3)
This is not a bug, but an expected behavior of Jalangi. We treat Array.push() as a native function in Jalangi. The method is called during recording, but is skipped during replay. Replay recreates the array x as it's elements are accessed. For example, the following code will give the correct output.
var x = new Array()
function f() {
x.push({p: "foo"});
console.log(x[0]);
console.log(x);
}
f()
If you do not want to skip the push method of Array during replay, you can modify the function getSymbolicFunctionToInvokeAndLog in analysis.js. However, you need to be really careful when you modify the function. You should never call push on a ConcolicValue.
from jalangi.
I see. Thanks for the clarification.
from jalangi.
I slightly disagree with the characterization here. This is not a bug, but it's because we do not model the fact that console.log
converts its argument to a string. The following example will work:
var x = new Array()
function f() {
x.push({p: "foo"})
console.log(String(x))
}
f()
It works by recording the return value of native function String
, not by re-constituting the array. While console
is not part of any standard specification, at some point we may want to model its behavior more accurately to avoid confusion; I'll open a separate issue.
from jalangi.
Related Issues (20)
- remove literal() callback for constructor calls? HOT 3
- support delete operation HOT 2
- no invokeFun callback when invoked function throws an exception
- Add ChainedAnalyses2 by default when running with analysis2 HOT 1
- ChainedAnalyses2 adds significant slowdown
- Wrong scope for the exception variable in catch blocks HOT 1
- No callbacks called for assignments to the for-in loop variable
- Weird instrumentation for for-in assignments to properties HOT 1
- Wrong instrumentation for reads of eval
- Feature request: callback for the getter/setter values
- Bug in computeTopLevelExpressions for `o.p += ...`
- Bug: analysis.declare gets isArgument=false, for a shared parameter and argument name
- no literal callback for top-level function declarations in eval'd string HOT 4
- tizen browser test failed on my machine HOT 1
- A mistake in documentation HOT 1
- shadowing of undefined HOT 1
- console.log.length HOT 1
- How can i use Jalangi framework in my use case HOT 1
- non-minified version of demo.js HOT 2
- Need help
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jalangi.