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

Specific null pointer. #399

Closed
Konstantin8105 opened this issue Dec 4, 2017 · 0 comments
Closed

Specific null pointer. #399

Konstantin8105 opened this issue Dec 4, 2017 · 0 comments

Comments

@Konstantin8105
Copy link
Contributor

Specific null pointer.
Found in shell.c

/* Return the current wall-clock time */
static sqlite3_int64 timeOfDay(void){
  static sqlite3_vfs *clockVfs = 0;
  // .....
  return t;
}

C code for test:

int main(){
        int *i = 0;
        return 0;
}

AST:

`-FunctionDecl 0x3174790 <1.c:1:1, line:4:1> line:1:5 main 'int ()'
  `-CompoundStmt 0x31c7048 <col:11, line:4:1>
    |-DeclStmt 0x31c6ff8 <line:2:2, col:12>
    | `-VarDecl 0x31c6f60 <col:2, col:11> col:7 i 'int *' cinit
    |   `-ImplicitCastExpr 0x31c6fe0 <col:11> 'int *' <NullToPointer>
    |     `-IntegerLiteral 0x31c6fc0 <col:11> 'int' 0
    `-ReturnStmt 0x31c7030 <line:3:2, col:9>
      `-IntegerLiteral 0x31c7010 <col:9> 'int' 0

Go:

func main() {
        __init()
        var i []int = noarch.IntToIntSlice(0)
        return
}
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