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

encode-ffi-field - syntax checking for field properties #302

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

Commits on Apr 26, 2020

  1. Cherry-pick patch for encode-ffi-field - syntax checking for field props

    Original changelog message:
    lib/db-io.lisp: Provide some syntax checking in encode-ffi-field
    
    Under some build configurations, after processing OS header files in
    some host environments, ffigen5 may produce field information having
    non-positive offset and/or width properties, in some specific fields.
    
    This changeset provides a rudimentary parse-time syntax check for such
    data, implemented here in `encode-ffi-field'. On encountering a negative
    offset or width for a field, the type check will signal a continuable
    error of type `simple-type-definition-error'. The continuation form
    would throw to the symbol, `ignore-type', with no values.
    
    Furthermore, if encountering a zero width for a field, tentatively the
    updated `encode-ffi-field' would produce a warning condition of type
    `simple-type-definition-warning'
    
    This also updates the following functions, to gracefully handle the
    catch symbol `ignore-type', such that may be thrown from the updated
    `encode-ffi-field'
    * save-ffi-objc-message
    * db-write-byte-list
    * save-ffi-function
    * save-ffi-typedef
    * save-ffi-struct
    * save-ffi-union
    * save-ffi-transparent-union
    * db-define-var
    * save-ffi-objc-class
    
    The following condition classes are added, each in a tentative
    definition, such as to be used in this simple type checking for ffigen
    data, in `encode-ffi-field'
    * simple-type-definition-error
    * simple-type-definition-warning
    
    This patch was originally developed circa October, 2019
    
    The patch has been tested, to a limited extent, under a Debian 10 amd64
    installation.
    
    (cherry picked from commit 333a1f8)
    spchamp committed Apr 26, 2020
    Configuration menu
    Copy the full SHA
    9658244 View commit details
    Browse the repository at this point in the history