Skip to content

Instantly share code, notes, and snippets.

@hacst
Forked from mkrautz/crash.c
Last active August 29, 2015 14:10
Show Gist options
  • Save hacst/44cd56f42db329be1ef8 to your computer and use it in GitHub Desktop.
Save hacst/44cd56f42db329be1ef8 to your computer and use it in GitHub Desktop.
// Build x64 version with "cl -O2 /fp:fast crash.c"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct TonalityAnalysis {
int count[2]; //< Remove this or change it to multiples of 4 and it works
float std[4];
};
int main() {
int i;
struct TonalityAnalysis *tonal = (struct TonalityAnalysis*)calloc(1, sizeof(struct TonalityAnalysis));
float features[4];
for (i = 0; i<4; i++)
features[i] = (float) sqrt(tonal->std[i]); //< Crash here
for (i = 0; i<4; i++)
printf("%.2f\n", features[i]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment