Skip to content

Commit

Permalink
ci: add basic Windows DEV job (#480)
Browse files Browse the repository at this point in the history
Rename the original 32bit job and add a basic 64bit one that
avoids the code that is still not warning free.

While at it, refactor a recent compile fix to avoid a runtime
assert.
  • Loading branch information
carenas committed Sep 18, 2024
1 parent c330129 commit 86d9ac3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 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: MSVC
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Configure
run: cmake -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2_DEBUG=ON -DPCRE2_BUILD_PCRE2GREP=OFF -DPCRE2_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DCMAKE_COMPILE_WARNING_AS_ERROR=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
8 changes: 4 additions & 4 deletions src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8908,10 +8908,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 All @@ -8922,7 +8922,7 @@ for (;;)
/* Fill in the ket */

*code = OP_KET;
PUT(code, 1, (int)(code - start_bracket));
PUT(code, 1, (uint32_t)(code - start_bracket));
code += 1 + LINK_SIZE;

/* Set values to pass back */
Expand Down Expand Up @@ -11120,7 +11120,7 @@ if (errorcode == 0 && cb.had_recurse)
}
}

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

Expand Down
11 changes: 5 additions & 6 deletions src/pcre2test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5071,15 +5071,14 @@ switch(cmd)
{
while (isspace(*argptr)) argptr++;
if (*argptr == 0) break;
for (i = 1; i < sizeof(newlines)/sizeof(char *); i++)
for (uint16_t j = 1; j < sizeof(newlines)/sizeof(char *); j++)
{
size_t nlen = strlen(newlines[i]);
if (strncmpic(argptr, (const uint8_t *)newlines[i], nlen) == 0 &&
size_t nlen = strlen(newlines[j]);
if (strncmpic(argptr, (const uint8_t *)newlines[j], nlen) == 0 &&
isspace(argptr[nlen]))
{
if (i == NEWLINE_DEFAULT) return PR_OK; /* Default is valid */
PCRE2_ASSERT(i <= UINT16_MAX);
if (first_listed_newline == 0) first_listed_newline = (uint16_t)i;
if (j == NEWLINE_DEFAULT) return PR_OK; /* Default is valid */
if (first_listed_newline == 0) first_listed_newline = j;
}
}
while (*argptr != 0 && !isspace(*argptr)) argptr++;
Expand Down

0 comments on commit 86d9ac3

Please sign in to comment.