Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to parse function pointer type typedef properly #69

Open
XVilka opened this issue Dec 10, 2024 · 0 comments
Open

Failure to parse function pointer type typedef properly #69

XVilka opened this issue Dec 10, 2024 · 0 comments

Comments

@XVilka
Copy link
Member

XVilka commented Dec 10, 2024

    FAILED: _rizin.cpython-38-x86_64-linux-gnu.so.p/meson-generated_.._rizin_wrap.cxx.o
    c++ -I_rizin.cpython-38-x86_64-linux-gnu.so.p -I. -I.. -I/opt/_internal/cpython-3.8.20/include/python3.8 -I/usr/local/include/librz -I/usr/local/include/librz/sdb -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -fPIC -MD -MQ _rizin.cpython-38-x86_64-linux-gnu.so.p/meson-generated_.._rizin_wrap.cxx.o -MF _rizin.cpython-38-x86_64-linux-gnu.so.p/meson-generated_.._rizin_wrap.cxx.o.d -o _rizin.cpython-38-x86_64-linux-gnu.so.p/meson-generated_.._rizin_wrap.cxx.o -c rizin_wrap.cxx
    rizin_wrap.cxx: In function 'PyObject* _wrap_RzBuffer_fwd_scan(PyObject*, PyObject*)':
    rizin_wrap.cxx:77903:31: error: invalid operands of types 'long long unsigned int' and 'std::nullptr_t' to binary 'operator!='
    77903 |   SWIG_contract_assert((result!=NULL), "Contract violation: require: (result!=NULL)");
          |                               ^
    rizin_wrap.cxx:3153:52: note: in definition of macro 'SWIG_contract_assert'
     3153 | #define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0)
          |                                                    ^~~~

If we check the function in question, it has this code:

typedef ut64 (*RzBufferFwdScan)(RZ_BORROW RZ_NONNULL const ut8 *buf, ut64 len, RZ_NULLABLE void *user);
RZ_API ut64 rz_buf_fwd_scan(RZ_NONNULL RzBuffer *b, ut64 start, ut64 amount, RZ_NONNULL RzBufferFwdScan fwd_scan, RZ_NULLABLE void *user);

/**
 * \brief Scans buffer linearly in chunks calling \p fwd_scan for each chunk.
 *
 * \param b RzBuffer to read
 * \param start Start address
 * \param amount Amount of bytes to read
 * \param fwd_scan Function to call for each chunk
 * \param user User data to pass to fwd_scan
 * \return Number of bytes read
 */
RZ_API ut64 rz_buf_fwd_scan(RZ_NONNULL RzBuffer *b, ut64 start, ut64 amount, RZ_NONNULL RzBufferFwdScan fwd_scan, RZ_NULLABLE void *user) {
	rz_return_val_if_fail(b && fwd_scan, 0);
	if (!amount) {
		return 0;
	}
       ...
}
@XVilka XVilka mentioned this issue Dec 10, 2024
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

No branches or pull requests

1 participant