#NEWLINE# def merge_shellcode( self , other ) : #NEWLINE# #INDENT# shared_labels = ( set ( self . labels ) & set ( other . labels ) ) #NEWLINE# if shared_labels : #NEWLINE# #INDENT# raise ValueError ( 'Cannot merge shellcode: shared labels {0}' . format ( shared_labels ) ) #NEWLINE# #UNINDENT# for ( offset , instr ) in sorted ( other . instrs . items ( ) ) : #NEWLINE# #INDENT# for label_name in [ name for ( name , label_offset ) in other . labels . items ( ) if ( label_offset == other ) ] : #NEWLINE# #INDENT# self . add_instruction ( Label ( label_name ) ) #NEWLINE# #UNINDENT# self . add_instruction ( instr )