Skip to content

Conversation

@brendandahl
Copy link
Collaborator

Previously, allow_raw_pointer<arg> mapped to allow_raw_pointers, which allowed pointers for all arguments. This PR implements the checks to verify just the specified argument or return value are allowed pointers.

Previously, allow_raw_pointer<arg<x>> mapped to allow_raw_pointers, which
allowed pointers for all arguments. This PR implements the checks to
verify just the specified argument or return value are allowed pointers.
@brendandahl brendandahl merged commit 6d61ffd into emscripten-core:main Dec 12, 2025
31 of 34 checks passed
@juj
Copy link
Collaborator

juj commented Dec 13, 2025

The new tests aren't happy on my CI, but give

======================================================================
FAIL: test_embind_no_raw_pointers_wrong_arg_allow (test_other.other.test_embind_no_raw_pointers_wrong_arg_allow)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 290, in resulting_test
    return func(self, *args)
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\test_other.py", line 3369, in test_embind_no_raw_pointers
    self.assert_fail([EMCC, '-lembind', test_file(filename)], 'Implicitly binding raw pointers is illegal')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 1212, in assert_fail
    err = self.expect_fail(cmd, **kwargs)
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 1197, in expect_fail
    self.assertNotEqual(proc.returncode, 0, 'subprocess unexpectedly succeeded. stderr:\n' + proc.stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 == 0 : subprocess unexpectedly succeeded. stderr:


======================================================================
FAIL: test_embind_no_raw_pointers_wrong_ret_allow (test_other.other.test_embind_no_raw_pointers_wrong_ret_allow)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 290, in resulting_test
    return func(self, *args)
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\test_other.py", line 3369, in test_embind_no_raw_pointers
    self.assert_fail([EMCC, '-lembind', test_file(filename)], 'Implicitly binding raw pointers is illegal')
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 1212, in assert_fail
    err = self.expect_fail(cmd, **kwargs)
  File "C:\buildbot\win11-x64-64gb-9800x3d\emscripten_win11_x64\build\emscripten\main\test\common.py", line 1197, in expect_fail
    self.assertNotEqual(proc.returncode, 0, 'subprocess unexpectedly succeeded. stderr:\n' + proc.stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 == 0 : subprocess unexpectedly succeeded. stderr:

http://clbri.com:8010/api/v2/logs/273025/raw_inline

Failure happens only on Windows, not on Linux or macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants