tronical.s

来自「The Valgrind distribution has multiple t」· S 代码 · 共 110 行

S
110
字号
/*2006-05-21: vex r1619 finally causes the x86->IR front end to stateexactly the %eflags dataflow surrounding 'cmpb $0, ... ;  js ..'and so memcheck no longer gives a false positive on this test.	-----------	(original comments)Assembly derived from the following program compiled with -O2.This fools Valgrind, causing it to give a false error.#include <stdio.h>struct Foo{    int a1 : 1;    int a2 : 1;    int a3 : 1;    int a4 : 1;    int a5 : 1;    int a6 : 1;    int a7 : 1;    int bleh : 1;};struct Foo* foo;void set(){    foo->bleh = 1;}void get(){    if ( foo->bleh == 0 )        printf( "blieb\n" );}int main(){  foo = malloc(sizeof(struct Foo));    set();    get();    return 0;}*/	.file	"tronical.c"	.version	"01.01"gcc2_compiled.:.text	.align 4.globl set	.type	 set,@functionset:	pushl	%ebp	movl	foo, %eax	orb	$128, (%eax)	movl	%esp, %ebp	popl	%ebp	ret.Lfe1:	.size	 set,.Lfe1-set	.section	.rodata.LC0:	.string	"blieb\n".text	.align 4.globl get	.type	 get,@functionget:	pushl	%ebp	movl	%esp, %ebp	subl	$8, %esp	movl	foo, %eax	cmpb	$0, (%eax)	js	.L4	subl	$12, %esp	pushl	$.LC0	call	printf	addl	$16, %esp.L4:	leave	ret.Lfe2:	.size	 get,.Lfe2-get	.align 4.globl main	.type	 main,@functionmain:	pushl	%ebp	movl	%esp, %ebp	subl	$20, %esp	pushl	$4	call	malloc	movl	%eax, foo	call	set	call	get	xorl	%eax, %eax	leave	ret.Lfe3:	.size	 main,.Lfe3-main	.comm	foo,4,4	.ident	"GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-98)"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?