Issue 14 in jitasm: call instr not working.

1 view
Skip to first unread message

jit...@googlecode.com

unread,
Feb 27, 2013, 2:59:36 PM2/27/13
to jitasm...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 14 by presenti...@gmail.com: call instr not working.
http://code.google.com/p/jitasm/issues/detail?id=14

I modified the sample tutorial1.cpp file as follows :-

#include "stdio.h"
#include "jitasm.h"

using namespace jitasm;

void foo(){
printf("INSIDE FOO");
}

Addr addr1 = Addr(RegID::Invalid(), (size_t)&foo);

struct tutorial1 : jitasm::function<uint64, tutorial1>
{
Reg a;

Result main()
{
mov(a, qword_ptr[addr1]);
call(a);
return a;
}
};

int main()
{
// Make function instance
tutorial1 f;

// Runtime code genaration and run
int result = f();

printf("Result : %d\n", result);

return 0;
}

After compiling above code & running it, I am getting "Segmentation fault".
Am I doing something wrong here ?

FYI, I am using the latest release of jitasm (0.7.1).

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

jit...@googlecode.com

unread,
Feb 28, 2013, 5:56:43 AM2/28/13
to jitasm...@googlegroups.com
Updates:
Status: Invalid

Comment #1 on issue 14 by aki.yamasaki: call instr not working.
http://code.google.com/p/jitasm/issues/detail?id=14

You cannot use RegID::Invalid as Addr base register ID.

mov(a, (size_t)&foo); should be work.

jit...@googlecode.com

unread,
Feb 28, 2013, 7:20:08 AM2/28/13
to jitasm...@googlegroups.com

Comment #2 on issue 14 by presenti...@gmail.com: call instr not working.
http://code.google.com/p/jitasm/issues/detail?id=14

It's working now. Thank a lot.
Reply all
Reply to author
Forward
0 new messages