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

gh-92434: Silence a compiler warning in _sqlite/connection.c for 32bit version #93090

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neonene
Copy link
Contributor

@neonene neonene commented May 23, 2022

MSVC emits a possible loss of data warning when building 32bit version of _sqlite3.Connection.serialize(), whose data size is limited to 0x7fffffff in sqlite-3.38.4.0/sqlite3.c, even on 64bit python:

SQLITE_PRIVATE void *sqlite3Malloc(u64 n){
  void *p;
  if( n==0 || n>=0x7fffff00 ){
    /* A memory allocation of a number of bytes which is near the maximum
    ** signed integer value might cause an integer overflow inside of the
    ** xMalloc().  Hence we limit the maximum size to 0x7fffff00, giving
    ** 255 bytes of overhead.  SQLite itself will never use anything near
    ** this amount.  The only way to reach the limit is with sqlite3_malloc() */
    p = 0;
  }else if( sqlite3GlobalConfig.bMemstat ){
    ...

#92434

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

Successfully merging this pull request may close these issues.

None yet

4 participants