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
ba500a6a
Commit
ba500a6a
authored
Jan 30, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store source context and starting line in bytecode_t.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
614ea7e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
compile.c
dlls/jscript/compile.c
+6
-4
engine.h
dlls/jscript/engine.h
+3
-1
function.c
dlls/jscript/function.c
+1
-1
global.c
dlls/jscript/global.c
+1
-1
jscript.c
dlls/jscript/jscript.c
+4
-3
No files found.
dlls/jscript/compile.c
View file @
ba500a6a
...
@@ -2258,7 +2258,7 @@ void release_bytecode(bytecode_t *code)
...
@@ -2258,7 +2258,7 @@ void release_bytecode(bytecode_t *code)
heap_free
(
code
);
heap_free
(
code
);
}
}
static
HRESULT
init_code
(
compiler_ctx_t
*
compiler
,
const
WCHAR
*
source
)
static
HRESULT
init_code
(
compiler_ctx_t
*
compiler
,
const
WCHAR
*
source
,
UINT64
source_context
,
unsigned
start_line
)
{
{
size_t
len
=
source
?
lstrlenW
(
source
)
:
0
;
size_t
len
=
source
?
lstrlenW
(
source
)
:
0
;
...
@@ -2270,6 +2270,8 @@ static HRESULT init_code(compiler_ctx_t *compiler, const WCHAR *source)
...
@@ -2270,6 +2270,8 @@ static HRESULT init_code(compiler_ctx_t *compiler, const WCHAR *source)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
compiler
->
code
->
ref
=
1
;
compiler
->
code
->
ref
=
1
;
compiler
->
code
->
source_context
=
source_context
;
compiler
->
code
->
start_line
=
start_line
;
heap_pool_init
(
&
compiler
->
code
->
heap
);
heap_pool_init
(
&
compiler
->
code
->
heap
);
compiler
->
code
->
source
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
compiler
->
code
->
source
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
...
@@ -2482,13 +2484,13 @@ static HRESULT compile_arguments(compiler_ctx_t *ctx, const WCHAR *args)
...
@@ -2482,13 +2484,13 @@ static HRESULT compile_arguments(compiler_ctx_t *ctx, const WCHAR *args)
return
parse_arguments
(
ctx
,
args
,
ctx
->
code
->
global_code
.
params
,
NULL
);
return
parse_arguments
(
ctx
,
args
,
ctx
->
code
->
global_code
.
params
,
NULL
);
}
}
HRESULT
compile_script
(
script_ctx_t
*
ctx
,
const
WCHAR
*
code
,
const
WCHAR
*
args
,
const
WCHAR
*
delimiter
,
HRESULT
compile_script
(
script_ctx_t
*
ctx
,
const
WCHAR
*
code
,
UINT64
source_context
,
unsigned
start_line
,
BOOL
from_eval
,
BOOL
use_decode
,
bytecode_t
**
ret
)
const
WCHAR
*
args
,
const
WCHAR
*
delimiter
,
BOOL
from_eval
,
BOOL
use_decode
,
bytecode_t
**
ret
)
{
{
compiler_ctx_t
compiler
=
{
0
};
compiler_ctx_t
compiler
=
{
0
};
HRESULT
hres
;
HRESULT
hres
;
hres
=
init_code
(
&
compiler
,
code
);
hres
=
init_code
(
&
compiler
,
code
,
source_context
,
start_line
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/engine.h
View file @
ba500a6a
...
@@ -182,6 +182,8 @@ struct _bytecode_t {
...
@@ -182,6 +182,8 @@ struct _bytecode_t {
function_code_t
global_code
;
function_code_t
global_code
;
WCHAR
*
source
;
WCHAR
*
source
;
UINT64
source_context
;
unsigned
start_line
;
BSTR
*
bstr_pool
;
BSTR
*
bstr_pool
;
unsigned
bstr_pool_size
;
unsigned
bstr_pool_size
;
...
@@ -194,7 +196,7 @@ struct _bytecode_t {
...
@@ -194,7 +196,7 @@ struct _bytecode_t {
struct
list
entry
;
struct
list
entry
;
};
};
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
const
WCHAR
*
,
BOOL
,
BOOL
,
bytecode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
UINT64
,
unsigned
,
const
WCHAR
*
,
const
WCHAR
*
,
BOOL
,
BOOL
,
bytecode_t
**
)
DECLSPEC_HIDDEN
;
void
release_bytecode
(
bytecode_t
*
)
DECLSPEC_HIDDEN
;
void
release_bytecode
(
bytecode_t
*
)
DECLSPEC_HIDDEN
;
static
inline
bytecode_t
*
bytecode_addref
(
bytecode_t
*
code
)
static
inline
bytecode_t
*
bytecode_addref
(
bytecode_t
*
code
)
...
...
dlls/jscript/function.c
View file @
ba500a6a
...
@@ -984,7 +984,7 @@ static HRESULT construct_function(script_ctx_t *ctx, unsigned argc, jsval_t *arg
...
@@ -984,7 +984,7 @@ static HRESULT construct_function(script_ctx_t *ctx, unsigned argc, jsval_t *arg
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
hres
=
compile_script
(
ctx
,
str
,
NULL
,
NULL
,
FALSE
,
FALSE
,
&
code
);
hres
=
compile_script
(
ctx
,
str
,
0
,
0
,
NULL
,
NULL
,
FALSE
,
FALSE
,
&
code
);
heap_free
(
str
);
heap_free
(
str
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/global.c
View file @
ba500a6a
...
@@ -204,7 +204,7 @@ HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned a
...
@@ -204,7 +204,7 @@ HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned a
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
TRACE
(
"parsing %s
\n
"
,
debugstr_jsval
(
argv
[
0
]));
TRACE
(
"parsing %s
\n
"
,
debugstr_jsval
(
argv
[
0
]));
hres
=
compile_script
(
ctx
,
src
,
NULL
,
NULL
,
TRUE
,
FALSE
,
&
code
);
hres
=
compile_script
(
ctx
,
src
,
0
,
0
,
NULL
,
NULL
,
TRUE
,
FALSE
,
&
code
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
WARN
(
"parse (%s) failed: %08x
\n
"
,
debugstr_jsval
(
argv
[
0
]),
hres
);
WARN
(
"parse (%s) failed: %08x
\n
"
,
debugstr_jsval
(
argv
[
0
]),
hres
);
return
throw_syntax_error
(
ctx
,
hres
,
NULL
);
return
throw_syntax_error
(
ctx
,
hres
,
NULL
);
...
...
dlls/jscript/jscript.c
View file @
ba500a6a
...
@@ -774,8 +774,8 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
...
@@ -774,8 +774,8 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
ctx
->
state
==
SCRIPTSTATE_CLOSED
)
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
ctx
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
return
E_UNEXPECTED
;
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
NULL
,
pstrDelimiter
,
(
dwFlags
&
SCRIPTTEXT_ISEXPRESSION
)
!=
0
,
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
dwSourceContextCookie
,
ulStartingLine
,
NULL
,
pstrDelimiter
,
This
->
is_encode
,
&
code
);
(
dwFlags
&
SCRIPTTEXT_ISEXPRESSION
)
!=
0
,
This
->
is_encode
,
&
code
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -871,7 +871,8 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars
...
@@ -871,7 +871,8 @@ static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptPars
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
ctx
->
state
==
SCRIPTSTATE_CLOSED
)
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
ctx
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
return
E_UNEXPECTED
;
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
pstrFormalParams
,
pstrDelimiter
,
FALSE
,
This
->
is_encode
,
&
code
);
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
dwSourceContextCookie
,
ulStartingLineNumber
,
pstrFormalParams
,
pstrDelimiter
,
FALSE
,
This
->
is_encode
,
&
code
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
WARN
(
"Parse failed %08x
\n
"
,
hres
);
WARN
(
"Parse failed %08x
\n
"
,
hres
);
return
hres
;
return
hres
;
...
...
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