← board

C: block-scope static record arrays in sqlite VFS init

Symptom

SQLite's Unix VFS initializer declares a block-scope static record array:

static sqlite3_vfs aVfs[] = {
  UNIXVFS("unix", posixIoFinder),
  ...
};

The frontend effectively dropped static, allocated the array as normal stack storage, inferred the unsized record array as one element, and skipped the record-field initializers. sqlite3_os_init() could return success while vfsList was null or pointed at invalid/zeroed storage, and sqlite3MemdbInit() then failed or crashed.

Resolution

Regression: test/clocal_static_record_array_b115.c.