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
c0e8f166
Commit
c0e8f166
authored
May 29, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
May 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw proper error for out of memory conditions in RegExp.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
e7b06b0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
regexp.c
dlls/jscript/regexp.c
+4
-7
No files found.
dlls/jscript/regexp.c
View file @
c0e8f166
...
...
@@ -45,8 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
#define ReportRegExpErrorHelper(a,b,c,d) throw_error((a)->context, E_FAIL, L"")
#define JS_ReportErrorNumber(a,b,c,d) throw_error((a), E_FAIL, L"")
#define JS_ReportErrorFlagsAndNumber(a,b,c,d,e,f) throw_error((a), E_FAIL, L"")
#define js_ReportOutOfScriptQuota(a) throw_error((a), E_FAIL, L"")
#define JS_ReportOutOfMemory(a) throw_error((a), E_FAIL, L"")
#define JS_COUNT_OPERATION(a,b) throw_error((a), E_FAIL, L"")
...
...
@@ -412,7 +410,7 @@ NewRENode(CompilerState *state, REOp op)
ren
=
heap_pool_alloc
(
state
->
pool
,
sizeof
(
*
ren
));
if
(
!
ren
)
{
/* js_ReportOutOfScriptQuota(cx); */
throw_error
(
state
->
context
,
E_OUTOFMEMORY
,
L""
);
return
NULL
;
}
ren
->
op
=
op
;
...
...
@@ -1944,7 +1942,7 @@ PushBackTrackState(REGlobalData *gData, REOp op,
btincr
=
((
btincr
+
btsize
-
1
)
/
btsize
)
*
btsize
;
gData
->
backTrackStack
=
heap_pool_grow
(
gData
->
pool
,
gData
->
backTrackStack
,
btsize
,
btincr
);
if
(
!
gData
->
backTrackStack
)
{
js_ReportOutOfScriptQuota
(
gData
->
cx
);
throw_error
(
gData
->
cx
,
E_OUTOFMEMORY
,
L""
);
gData
->
ok
=
FALSE
;
return
NULL
;
}
...
...
@@ -2112,7 +2110,7 @@ ProcessCharSet(REGlobalData *gData, RECharSet *charSet)
byteLength
=
(
charSet
->
length
>>
3
)
+
1
;
charSet
->
u
.
bits
=
malloc
(
byteLength
);
if
(
!
charSet
->
u
.
bits
)
{
JS_ReportOutOfMemory
(
gData
->
cx
);
throw_error
(
gData
->
cx
,
E_OUTOFMEMORY
,
L""
);
gData
->
ok
=
FALSE
;
return
FALSE
;
}
...
...
@@ -2300,7 +2298,7 @@ ReallocStateStack(REGlobalData *gData)
gData
->
stateStack
=
heap_pool_grow
(
gData
->
pool
,
gData
->
stateStack
,
sz
,
sz
);
if
(
!
gData
->
stateStack
)
{
js_ReportOutOfScriptQuota
(
gData
->
cx
);
throw_error
(
gData
->
cx
,
E_OUTOFMEMORY
,
L""
);
gData
->
ok
=
FALSE
;
return
FALSE
;
}
...
...
@@ -3131,7 +3129,6 @@ static HRESULT InitMatch(regexp_t *re, void *cx, heap_pool_t *pool, REGlobalData
return
S_OK
;
bad:
js_ReportOutOfScriptQuota
(
cx
);
gData
->
ok
=
FALSE
;
return
E_OUTOFMEMORY
;
}
...
...
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