sourcepawn/jit/x86/jit_x86.cpp
changeset 253 881b1fbcc698
parent 243 adbe663573e9
child 344 32c78f9355d4
     1.1 --- a/sourcepawn/jit/x86/jit_x86.cpp	Mon Jan 01 19:50:16 2007 +0000
     1.2 +++ b/sourcepawn/jit/x86/jit_x86.cpp	Mon Jan 01 20:58:02 2007 +0000
     1.3 @@ -2119,8 +2119,23 @@
     1.4  		{
     1.5  			sym = (sp_fdbg_symbol_t *)cursor;
     1.6  
     1.7 -			ctx->symbols[iter].codestart = RelocLookup(jit, sym->codestart, false);
     1.8 -			ctx->symbols[iter].codeend = RelocLookup(jit, sym->codeend, false);
     1.9 +			/**
    1.10 +			 * @brief There is an "issue" where the compiler will give totally bogus code 
    1.11 +			 * address because codegeneration is still being calculated.  A simple fix for 
    1.12 +			 * this is to coerce the codestart value to 0 when it's invalid.
    1.13 +			 */
    1.14 +			if (sym->codestart > data->codesize)
    1.15 +			{
    1.16 +				ctx->symbols[iter].codestart = 0;
    1.17 +			} else {
    1.18 +				ctx->symbols[iter].codestart = RelocLookup(jit, sym->codestart, false);
    1.19 +			}
    1.20 +			if (sym->codeend > data->codesize)
    1.21 +			{
    1.22 +				ctx->symbols[iter].codeend = data->codesize;
    1.23 +			} else {
    1.24 +				ctx->symbols[iter].codeend = RelocLookup(jit, sym->codeend, false);
    1.25 +			}
    1.26  			ctx->symbols[iter].name = strbase + sym->name;
    1.27  			ctx->symbols[iter].sym = sym;
    1.28  
    1.29 @@ -2261,3 +2276,13 @@
    1.30  
    1.31  	return fnc->num_functions;
    1.32  }
    1.33 +
    1.34 +const char *JITX86::GetVersionString()
    1.35 +{
    1.36 +	return "1.0.0.0";
    1.37 +}
    1.38 +
    1.39 +const char *JITX86::GetCPUOptimizations()
    1.40 +{
    1.41 +	return "Generic 80486";
    1.42 +}