Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
11453b24
Commit
11453b24
authored
Jan 02, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Always alloc the first chunk of code buffer.
parent
ea185259
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
17 deletions
+26
-17
compile.c
dlls/jscript/compile.c
+26
-17
No files found.
dlls/jscript/compile.c
View file @
11453b24
...
...
@@ -150,12 +150,7 @@ static unsigned push_instr(compiler_ctx_t *ctx, jsop_t op)
{
assert
(
ctx
->
code_size
>=
ctx
->
code_off
);
if
(
!
ctx
->
code_size
)
{
ctx
->
code
->
instrs
=
heap_alloc
(
64
*
sizeof
(
instr_t
));
if
(
!
ctx
->
code
->
instrs
)
return
-
1
;
ctx
->
code_size
=
64
;
}
else
if
(
ctx
->
code_size
==
ctx
->
code_off
)
{
if
(
ctx
->
code_size
==
ctx
->
code_off
)
{
instr_t
*
new_instrs
;
new_instrs
=
heap_realloc
(
ctx
->
code
->
instrs
,
ctx
->
code_size
*
2
*
sizeof
(
instr_t
));
...
...
@@ -1647,22 +1642,36 @@ void release_compiler(compiler_ctx_t *ctx)
static
HRESULT
init_compiler
(
parser_ctx_t
*
parser
)
{
if
(
!
parser
->
code
)
{
parser
->
code
=
heap_alloc_zero
(
sizeof
(
bytecode_t
));
if
(
!
parser
->
code
)
return
E_OUTOFMEMORY
;
jsheap_init
(
&
parser
->
code
->
heap
);
compiler_ctx_t
*
compiler
;
if
(
parser
->
compiler
)
return
S_OK
;
compiler
=
heap_alloc_zero
(
sizeof
(
*
compiler
));
if
(
!
compiler
)
return
E_OUTOFMEMORY
;
compiler
->
code
=
heap_alloc_zero
(
sizeof
(
bytecode_t
));
if
(
!
compiler
->
code
)
{
release_compiler
(
compiler
);
return
E_OUTOFMEMORY
;
}
if
(
!
parser
->
compiler
)
{
parser
->
compiler
=
heap_alloc_zero
(
sizeof
(
compiler_ctx_t
));
if
(
!
parser
->
compiler
)
return
E_OUTOFMEMORY
;
jsheap_init
(
&
compiler
->
code
->
heap
);
parser
->
compiler
->
parser
=
parser
;
parser
->
compiler
->
code
=
parser
->
code
;
compiler
->
code
->
instrs
=
heap_alloc
(
64
*
sizeof
(
instr_t
));
if
(
!
compiler
->
code
->
instrs
)
{
release_bytecode
(
compiler
->
code
);
release_compiler
(
compiler
);
return
E_OUTOFMEMORY
;
}
compiler
->
code_size
=
64
;
compiler
->
parser
=
parser
;
parser
->
code
=
compiler
->
code
;
parser
->
compiler
=
compiler
;
return
S_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment