You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
914 B

/*
* Copyright (c) 2014 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
int main1 (int y) {
static int s = 3;
int x =7;
int add1, add2;
int (^addblock)(int a, int b);
addblock=^(int c,int d){
int (^addblock2)(int a);
int add2;
int bla =3;
addblock2=^(int z){
return z+s+x+bla;
};
add2 = addblock2(1);
return c+add2+bla;
};
add1 = addblock(1,2);
addblock=^(int e,int f){
return e-s;
};
add2 = addblock(3,2);
// Here we should get a division by zero
y=add1/add2;
return y;
}
int main () {
return main1(4);
}