Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carenas committed Sep 13, 2024
1 parent 5e75d9b commit ba3d49f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: ./pcre2posix_test -v

bat:
name: MSVC
name: 32bit MSVC
runs-on: windows-latest
steps:
- name: Checkout
Expand All @@ -89,6 +89,28 @@ jobs:
ctest -C Debug .
type Testing\Temporary\LastTest.log
pterodactyl:
name: 64bit MSVC
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Configure
run: cmake -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DCMAKE_VERBOSE_MAKEFILE=ON -B build

- name: Build
run: cmake --build build

- name: Test
shell: cmd
run: |
cd build
ctest -C Debug .
type Testing\Temporary\LastTest.log
bigbird:
name: manyconfig
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Upload the results as artifacts (optional).
- name: "Upload artifact"
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
uses: actions/upload-artifact@v4
with:
name: SARIF file
path: results.sarif
Expand Down
6 changes: 3 additions & 3 deletions src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8774,10 +8774,10 @@ for (;;)
{
if (lengthptr == NULL)
{
PCRE2_SIZE branch_length = code - last_branch;
uint32_t branch_length = (uint32_t)(code - last_branch);
do
{
PCRE2_SIZE prev_length = GET(last_branch, 1);
uint32_t prev_length = GET(last_branch, 1);
PUT(last_branch, 1, branch_length);
branch_length = prev_length;
last_branch -= branch_length;
Expand Down Expand Up @@ -10986,7 +10986,7 @@ if (errorcode == 0 && cb.had_recurse)
}
}

PUT(rcode, 1, rgroup - codestart);
PUT(rcode, 1, (uint32_t)(rgroup - codestart));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/pcre2_intmodedep.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ values of 3 or 4 are also supported. */
(a[n] = (PCRE2_UCHAR)((d) >> 8)), \
(a[(n)+1] = (PCRE2_UCHAR)((d) & 255))
#define GET(a,n) \
(unsigned int)(((a)[n] << 8) | (a)[(n)+1])
(uint32_t)(((a)[n] << 8) | (a)[(n)+1])
#define MAX_PATTERN_SIZE (1 << 16)

#elif LINK_SIZE == 3
Expand All @@ -115,7 +115,7 @@ values of 3 or 4 are also supported. */
(a[(n)+1] = (PCRE2_UCHAR)((d) >> 8)), \
(a[(n)+2] = (PCRE2_UCHAR)((d) & 255))
#define GET(a,n) \
(unsigned int)(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])
(uint32_t)(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])
#define MAX_PATTERN_SIZE (1 << 24)

#elif LINK_SIZE == 4
Expand All @@ -125,7 +125,7 @@ values of 3 or 4 are also supported. */
(a[(n)+2] = (PCRE2_UCHAR)((d) >> 8)), \
(a[(n)+3] = (PCRE2_UCHAR)((d) & 255))
#define GET(a,n) \
(unsigned int)(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
(uint32_t)(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */

#else
Expand Down

0 comments on commit ba3d49f

Please sign in to comment.