Skip to content
Browse files

Don't register variables on the stack as global

By definition, VALUE pointers on the stack can never be a global variable.
The location goes out of scope when the function is executed and
can point at random data.

On the other hand, the error class is used as global so mark it as such.
  • Loading branch information...
1 parent ff15ead commit 159b6e079be4d7402410cb21fce61a786e7c3a0f @dbussink dbussink committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 ext/sequel_pg/sequel_pg.c
View
2 ext/sequel_pg/sequel_pg.c
@@ -1009,7 +1009,7 @@ void Init_sequel_pg(void) {
rb_global_variable(&spg_BigDecimal);
rb_global_variable(&spg_Date);
rb_global_variable(&spg_SQLTime);
- rb_global_variable(&spg_Postgres);
+ rb_global_variable(&spg_PGError);
rb_global_variable(&spg_nan);
rb_global_variable(&spg_pos_inf);
rb_global_variable(&spg_neg_inf);

0 comments on commit 159b6e0

Please sign in to comment.
Something went wrong with that request. Please try again.