Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Last active February 2, 2016 22:25
Show Gist options
  • Save daniel-nelson/e6e79292d2395b32874a to your computer and use it in GitHub Desktop.
Save daniel-nelson/e6e79292d2395b32874a to your computer and use it in GitHub Desktop.
struct order *orders;
// ...
// *orders is assigned to point to a block of memory returned by ALLOC_N (from ruby.h)
// ...
// Data in *orders is fine here
struct winning_order winners[winners_length];
// Data in *orders is corrupt here (see below)
Subset of data pre and post local declaration of "winners" variable:
Pre Post
---- ----
2017 2017
1982 1982
3374 3374
3374 3374
1144 1144
402 11889714077703300994
1144 1144
402 402
2454 2454
2454 2454
2428 2428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment