Skip to content

Commit

Permalink
update fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Nov 11, 2012
1 parent 18e33b2 commit f24d583
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@
#include "Relooper.h"
int main() {
Debugging::On = 0;
char *buffer = (char*)malloc(10*1024*1024);
Relooper::SetOutputBuffer(buffer);
Relooper::SetOutputBuffer(buffer, 10*1024*1024);
'''

for i in range(1, num):
Expand Down Expand Up @@ -100,14 +98,14 @@
open('fuzz.slow.js', 'w').write(slow)
open('fuzz.cpp', 'w').write(fast)
print '_'
slow_out = subprocess.Popen(['mozjs', '-m', '-n', 'fuzz.slow.js'], stdout=subprocess.PIPE).communicate()[0]
slow_out = subprocess.Popen(['/home/alon/Dev/mozilla-central/js/src/fast/js', '-m', '-n', 'fuzz.slow.js'], stdout=subprocess.PIPE).communicate()[0]

print '.'
subprocess.call(['g++', 'fuzz.cpp', 'Relooper.o', '-o', 'fuzz', '-g'])
print '*'
subprocess.call(['./fuzz'], stdout=open('fuzz.fast.js', 'w'))
print '-'
fast_out = subprocess.Popen(['mozjs', '-m', '-n', 'fuzz.fast.js'], stdout=subprocess.PIPE).communicate()[0]
fast_out = subprocess.Popen(['/home/alon/Dev/mozilla-central/js/src/fast/js', '-m', '-n', 'fuzz.fast.js'], stdout=subprocess.PIPE).communicate()[0]
print

if slow_out != fast_out:
Expand Down

0 comments on commit f24d583

Please sign in to comment.