view gen.c @ 572:0f32f52fc98e

Make some small changes in trans so that it is more likely to produce the same output as mustrans when given misbehaving programs. Add lea to testcases.txt. Improve the output of comparetest.py so that known issues can easily be separated from new ones.
author Michael Pavone <pavone@retrodev.com>
date Mon, 03 Mar 2014 21:08:43 -0800
parents c8fefa140c80
children 724bbec47f86
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include "gen.h"
#include "mem.h"

void init_code_info(code_info *code)
{
	size_t size = CODE_ALLOC_SIZE;
	code->cur = alloc_code(&size);
	if (!code->cur) {
		fputs("Failed to allocate memory for generated code\n", stderr);
		exit(1);
	}
	code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS;
}