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
89711e35
Commit
89711e35
authored
Feb 15, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Don't use jsstr_t in JSRegExp structure.
parent
02d63cb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
regexp.c
dlls/jscript/regexp.c
+16
-15
No files found.
dlls/jscript/regexp.c
View file @
89711e35
...
...
@@ -74,7 +74,8 @@ typedef struct {
size_t
parenCount
;
/* number of parenthesized submatches */
size_t
classCount
;
/* count [...] bitmaps */
RECharSet
*
classList
;
/* list of [...] bitmaps */
jsstr_t
*
source
;
/* locked source string, sans // */
const
WCHAR
*
source
;
/* locked source string, sans // */
DWORD
source_len
;
jsbytecode
program
[
1
];
/* regular expression bytecode */
}
JSRegExp
;
...
...
@@ -2038,7 +2039,7 @@ PushBackTrackState(REGlobalData *gData, REOp op,
}
static
inline
REMatchState
*
FlatNIMatcher
(
REGlobalData
*
gData
,
REMatchState
*
x
,
WCHAR
*
matchChars
,
FlatNIMatcher
(
REGlobalData
*
gData
,
REMatchState
*
x
,
const
WCHAR
*
matchChars
,
size_t
length
)
{
size_t
i
;
...
...
@@ -2157,13 +2158,12 @@ ProcessCharSet(REGlobalData *gData, RECharSet *charSet)
* source string.
*/
assert
(
1
<=
charSet
->
u
.
src
.
startIndex
);
assert
(
charSet
->
u
.
src
.
startIndex
<
jsstr_length
(
gData
->
regexp
->
source
));
assert
(
charSet
->
u
.
src
.
length
<=
jsstr_length
(
gData
->
regexp
->
source
)
-
1
-
charSet
->
u
.
src
.
startIndex
);
assert
(
charSet
->
u
.
src
.
startIndex
<
gData
->
regexp
->
source_len
);
assert
(
charSet
->
u
.
src
.
length
<=
gData
->
regexp
->
source_len
-
1
-
charSet
->
u
.
src
.
startIndex
);
charSet
->
converted
=
TRUE
;
src
=
gData
->
regexp
->
source
->
str
+
charSet
->
u
.
src
.
startIndex
;
src
=
gData
->
regexp
->
source
+
charSet
->
u
.
src
.
startIndex
;
end
=
src
+
charSet
->
u
.
src
.
length
;
...
...
@@ -2392,7 +2392,7 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
size_t
parenIndex
;
size_t
offset
,
length
,
index
;
jsbytecode
*
pc
=
*
startpc
;
/* pc has already been incremented past op */
WCHAR
*
source
;
const
WCHAR
*
source
;
const
WCHAR
*
startcp
=
x
->
cp
;
WCHAR
ch
;
RECharSet
*
charSet
;
...
...
@@ -2488,12 +2488,12 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
break
;
case
REOP_FLAT
:
pc
=
ReadCompactIndex
(
pc
,
&
offset
);
assert
(
offset
<
jsstr_length
(
gData
->
regexp
->
source
)
);
assert
(
offset
<
gData
->
regexp
->
source_len
);
pc
=
ReadCompactIndex
(
pc
,
&
length
);
assert
(
1
<=
length
);
assert
(
length
<=
jsstr_length
(
gData
->
regexp
->
source
)
-
offset
);
assert
(
length
<=
gData
->
regexp
->
source_len
-
offset
);
if
(
length
<=
(
size_t
)(
gData
->
cpend
-
x
->
cp
))
{
source
=
gData
->
regexp
->
source
->
str
+
offset
;
source
=
gData
->
regexp
->
source
+
offset
;
TRACE
(
"%s
\n
"
,
debugstr_wn
(
source
,
length
));
for
(
index
=
0
;
index
!=
length
;
index
++
)
{
if
(
source
[
index
]
!=
x
->
cp
[
index
])
...
...
@@ -2513,11 +2513,11 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
break
;
case
REOP_FLATi
:
pc
=
ReadCompactIndex
(
pc
,
&
offset
);
assert
(
offset
<
jsstr_length
(
gData
->
regexp
->
source
)
);
assert
(
offset
<
gData
->
regexp
->
source_len
);
pc
=
ReadCompactIndex
(
pc
,
&
length
);
assert
(
1
<=
length
);
assert
(
length
<=
jsstr_length
(
gData
->
regexp
->
source
)
-
offset
);
source
=
gData
->
regexp
->
source
->
str
;
assert
(
length
<=
gData
->
regexp
->
source_len
-
offset
);
source
=
gData
->
regexp
->
source
;
result
=
FlatNIMatcher
(
gData
,
x
,
source
+
offset
,
length
);
break
;
case
REOP_FLAT1i
:
...
...
@@ -3303,7 +3303,8 @@ js_NewRegExp(script_ctx_t *cx, jsstr_t *str, UINT flags, BOOL flat)
re
->
flags
=
flags
;
re
->
parenCount
=
state
.
parenCount
;
re
->
source
=
str
;
re
->
source
=
str
->
str
;
re
->
source_len
=
jsstr_length
(
str
);
out:
heap_pool_clear
(
mark
);
...
...
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