~harrison-rt/sapidlib/fluffos

« back to all changes in this revision

Viewing changes to testsuite/single/tests/crasher/864.c

  • Committer: Yucong Sun
  • Date: 2021-10-31 00:29:17 UTC
  • Revision ID: git-v1:3fe705f8a65268569007e8480c0a9a3dfa3c1773
Fix crash in null REF variable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
varargs void two(string ref *values);
 
2
void one()
 
3
{
 
4
  two();  // Will this crash or cause a problem?
 
5
}
 
6
 
 
7
varargs void two(string ref *values)
 
8
{
 
9
  if(!values) {
 
10
  printf("Failure\n");
 
11
  return;
 
12
}
 
13
  values = allocate(1) ;
 
14
  values[0] = "boop" ;
 
15
}
 
16
 
 
17
void do_tests() {
 
18
  one();
 
19
}